@raac/rpc 1.1.0-beta.33 → 1.1.0-beta.35

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.
@@ -17,7 +17,7 @@
17
17
  "raachouseprices": {
18
18
  "id": "raachouseprices",
19
19
  "name": "RAAC House Prices",
20
- "contract": "0x3aD29bF120251BF7B2616B7460d38796535E0753"
20
+ "contract": "0xE688B98a8C8480253574582Bde2ce73c36323b47"
21
21
  },
22
22
  "auctionfactory": {
23
23
  "id": "auctionfactory",
@@ -37,12 +37,12 @@
37
37
  "feecollector": {
38
38
  "id": "feecollector",
39
39
  "name": "Fee Collector",
40
- "contract": "0xA7154A854A86050C69Fc2081f0464ba48a1E6830"
40
+ "contract": "0x01BAd92617CD467AD491Bf8D76A098508EEC55CF"
41
41
  },
42
42
  "treasury": {
43
43
  "id": "treasury",
44
44
  "name": "Treasury",
45
- "contract": "0x6e647B74E06fc008043174EF9fbB06629E143b70"
45
+ "contract": "0x36b5fF02919Ce6598c93783EC931095BF18dd390"
46
46
  },
47
47
  "repairfund": {
48
48
  "id": "repairfund",
@@ -57,26 +57,26 @@
57
57
  "rwavault": {
58
58
  "id": "rwavault",
59
59
  "name": "RWA Vault",
60
- "contract": "0xB28264c78bFFAc4Ff4Bc9dB76F138CbaD865F642"
60
+ "contract": "0x57523816aB3304F3E2A0AaE0Ef4409771Ab14ac0"
61
61
  }
62
62
  },
63
63
  "pools": {
64
64
  "stabilitypool": {
65
65
  "id": "stabilitypool",
66
66
  "name": "Stability Pool",
67
- "contract": "0x8B8265469B5495c67373fC0655F2c78AcBdAfa5f"
67
+ "contract": "0x791F89EA68e806ea3B3889C16e82B56Df0eDCafE"
68
68
  },
69
69
  "lendingpool": {
70
70
  "id": "lendingpool",
71
71
  "name": "Lending Pool",
72
- "contract": "0x29f12b7195A863043C437Ae88ffAFd1e0C89Ec2E"
72
+ "contract": "0x77503D1322542516Ff1f1DF8111cB5830A8Db21B"
73
73
  }
74
74
  },
75
75
  "nfts": {
76
76
  "raacnft": {
77
77
  "id": "raacnft",
78
78
  "name": "RAAC NFT",
79
- "contract": "0xEA034D093C73eaF20dBB3d2489B39b4c86848465"
79
+ "contract": "0xede704b9e6da6BE4Ca29579433b06A6D93cB3d99"
80
80
  }
81
81
  },
82
82
  "assets": {
@@ -90,43 +90,43 @@
90
90
  "id": "crvusd",
91
91
  "name": "CRVUSD",
92
92
  "decimals": 18,
93
- "contract": "0x144346562EE47526D945E86d55C4203642C3b7fD"
93
+ "contract": "0x18f6B29139F652ea0CfA8a91E9395177B89D1a76"
94
94
  },
95
95
  "rtoken": {
96
96
  "id": "rtoken",
97
97
  "name": "RToken",
98
98
  "decimals": 18,
99
- "contract": "0x80D0747737453D30dCE3167bB1284B6c0e6bC5db"
99
+ "contract": "0xc6656114ceF4DDE5dad727EA7a422a1b3741fBcF"
100
100
  },
101
101
  "detoken": {
102
102
  "id": "detoken",
103
103
  "name": "DEToken",
104
104
  "decimals": 18,
105
- "contract": "0x34c4245991d5041BA8ebA6269B7b9386c32BDEEe"
105
+ "contract": "0xd1322149cbCB14Be59C325b80dcc77F35E25aD6e"
106
106
  },
107
107
  "raactoken": {
108
108
  "id": "raactoken",
109
109
  "name": "RAAC",
110
110
  "decimals": 18,
111
- "contract": "0xB1839AE38339Dc0035571cf856BF24254a27FbBC"
111
+ "contract": "0xDa9191E1E814AC747e183179C8b0e5253F267a70"
112
112
  },
113
113
  "veraac": {
114
114
  "id": "veraac",
115
115
  "name": "VERAAC",
116
116
  "decimals": 18,
117
- "contract": "0x6eB1E8Ee1F16D23db63Dd8FCe8d127041E8a9588"
117
+ "contract": "0x792d45e877E43e128B64dA80832C07069796f84b"
118
118
  },
119
119
  "debttoken": {
120
120
  "id": "debttoken",
121
121
  "name": "Debt Token",
122
122
  "decimals": 18,
123
- "contract": "0x596917E0180fcBa1d809511A743Ea7d4ccf92Ca9"
123
+ "contract": "0xD052BCB4350E155800f9411a90e986DC9B56F155"
124
124
  },
125
125
  "rwaindextoken": {
126
126
  "id": "rwaindextoken",
127
127
  "name": "RWA Index Token",
128
128
  "decimals": 18,
129
- "contract": "0x1be9E0875edfbAE72D087500c502b5F84ca9E9Da"
129
+ "contract": "0x353d6be8d15f8aB007f2e2226d89BC029562AC36"
130
130
  }
131
131
  },
132
132
  "adapters": {
@@ -134,13 +134,13 @@
134
134
  "raacnftadapter": {
135
135
  "id": "raacnftadapter",
136
136
  "name": "RAAC NFT Adapter",
137
- "contract": "0x062a65756a436f9Ec04438046C7a1Fa481B1F804",
137
+ "contract": "0x3655dA5c1E71cC9292049149F9762d90558c416A",
138
138
  "type": "ERC721"
139
139
  },
140
140
  "rwaindextokenadapter": {
141
141
  "id": "rwaindextokenadapter",
142
142
  "name": "RWA Index Token",
143
- "contract": "0x28Ca5D9D8429d76c800Bd076Cb267F7127176364",
143
+ "contract": "0x341cb5fbF7736Cc51833c8C40d16084ebBA9e75E",
144
144
  "type": "ERC20"
145
145
  }
146
146
  },
@@ -148,13 +148,13 @@
148
148
  "raacnftadapter": {
149
149
  "id": "raacnftadapter",
150
150
  "name": "RAAC NFT Adapter",
151
- "contract": "0x87B61bbe2E64954654DB2536538Eaa67ccf45D95",
151
+ "contract": "0x953fCaF68f5e39b4CbA20736b00316EED5F9Ac1a",
152
152
  "type": "ERC721"
153
153
  },
154
154
  "crvusdadapter": {
155
155
  "id": "crvusdadapter",
156
156
  "name": "CRVUSD Adapter",
157
- "contract": "0x37301c8D830BBa21b5e7CeDE1d25A541e49cDA9C",
157
+ "contract": "0x9fE97FD9EB2DDe9db59a275030C6d33351a09bbd",
158
158
  "type": "ERC20"
159
159
  }
160
160
  }
@@ -10,7 +10,7 @@ const RPCLibrary_1 = __importDefault(require("../RPCLibrary"));
10
10
  const contracts_1 = require("../utils/contracts");
11
11
  const artifacts_1 = require("../utils/artifacts");
12
12
  const _helpers_1 = require("../pools/rwaVault/_helpers");
13
- const chainId = 8453;
13
+ const chainId = 11155111;
14
14
  const config = chains_1.default[chainId];
15
15
  const TEST_MNEMONIC = process.env.TEST_MNEMONIC;
16
16
  const TEST_PRIVATE_KEY = process.env.TEST_PRIVATE_KEY;
@@ -18,16 +18,14 @@ async function getProvider() {
18
18
  return new ethers_1.ethers.JsonRpcProvider(config.rpcs[0]);
19
19
  }
20
20
  async function createWallet(mnemonic, provider) {
21
- const wallet = ethers_1.ethers.Wallet.fromPhrase(mnemonic, provider);
22
- console.info(`[${chainId}]: Loaded wallet from mnemonic: ${wallet.address}`);
23
- // the signer is the wallet
24
- return wallet;
25
- // load from private key
26
- // const wallet = new ethers.Wallet(TEST_PRIVATE_KEY, provider);
27
- // console.info(
28
- // `[${chainId}]: Loaded wallet from private key: ${wallet.address}`
29
- // );
21
+ // const wallet = ethers.Wallet.fromPhrase(mnemonic, provider);
22
+ // console.info(`[${chainId}]: Loaded wallet from mnemonic: ${wallet.address}`);
23
+ // // the signer is the wallet
30
24
  // return wallet;
25
+ // load from private key
26
+ const wallet = new ethers_1.ethers.Wallet(TEST_PRIVATE_KEY, provider);
27
+ console.info(`[${chainId}]: Loaded wallet from private key: ${wallet.address}`);
28
+ return wallet;
31
29
  }
32
30
  async function setup() {
33
31
  const provider = await getProvider();
@@ -36,15 +34,28 @@ async function setup() {
36
34
  rpc.address = signer.address;
37
35
  rpc.provider = provider;
38
36
  rpc.chainId = chainId;
39
- // // send myself some CRVUSD
40
- await rpc.wallet.assets.mintAsset(chainId, "crvusd", 10000000n, signer.address, signer);
37
+ // // // send myself some CRVUSD
38
+ // await rpc.wallet.assets.mintAsset(
39
+ // chainId,
40
+ // "crvusd",
41
+ // 10000000n,
42
+ // signer.address,
43
+ // signer
44
+ // );
41
45
  // // set the base uri to instruxi data gateway
42
- await rpc.nfts.setBaseUri(chainId, "http://44.211.155.244:3000/v1/properties/", signer);
46
+ // await rpc.nfts.setBaseUri(
47
+ // chainId,
48
+ // "http://44.211.155.244:3000/v1/properties/",
49
+ // signer
50
+ // );
51
+ const RWAVaultAddress = (0, contracts_1.getContractAddress)(chainId, "rwavault");
52
+ const RWAVaultABI = (0, artifacts_1.getABI)("rwavault");
53
+ const RWAVaultContract = new ethers_1.ethers.Contract(RWAVaultAddress, RWAVaultABI, signer);
54
+ console.log(await RWAVaultContract.vrfConsumer());
55
+ return;
43
56
  console.log(await rpc.pools.lendingPool.getLendingPoolInfo(chainId, signer.address, provider));
44
57
  console.log(await rpc.wallet.assets.getBalance(chainId, "rtoken", signer.address, provider));
45
- // console.log(
46
- // await rpc.nfts.getTokensByOwner(chainId, signer.address, provider)
47
- // );
58
+ console.log(await rpc.nfts.getTokensByOwner(chainId, signer.address, provider));
48
59
  // // // set the oracle address of the RAACHousePrice. TEmporarily simulating that I AM THE ORACLE
49
60
  await rpc.contracts.housePrices.setOracle(chainId, signer.address, signer);
50
61
  // // // // // set price for 3 houses
@@ -80,7 +91,7 @@ async function setup() {
80
91
  throw new Error("Price not set correctly");
81
92
  }
82
93
  }
83
- let nftIdStart = countTokens + 1;
94
+ let nftIdStart = countTokens + 3;
84
95
  let nftIdEnd = countTokens + 10;
85
96
  for (let i = nftIdStart; i <= nftIdEnd; i++) {
86
97
  const price = Math.floor(Math.random() * (2000000 - 100000) + 100000);
@@ -138,6 +149,7 @@ const execute = async () => {
138
149
  const vaultTokenAddress = await rwaVaultContract.vaultToken();
139
150
  const vaultTokenABI = (0, artifacts_1.getABI)("rwaindextoken");
140
151
  const vaultTokenContract = new ethers_1.ethers.Contract(vaultTokenAddress, vaultTokenABI, signer);
152
+ // ====== THIS FAILS IN SEPOLIA BECAUSE WE DO NOT WAIT FOR TX TO FINISH. THE METHODS DO NOT RETURN TX and they do not wait.
141
153
  // console.log("CRVUSD address", await getContractAddress(chainId, "crvusd"));
142
154
  // console.log("CRVUSD address", await erc20AdapterContract.getAssetToken());
143
155
  // console.log("Total value", await erc20AdapterContract.totalValue());
@@ -168,6 +180,7 @@ const updateNFTPrice = async (id, price) => {
168
180
  const housePriceContract = new ethers_1.ethers.Contract(housePriceAddress, housePriceABI, signer);
169
181
  let tx;
170
182
  tx = await housePriceContract.setHousePrice(id, ethers_1.ethers.parseEther(price));
183
+ await tx.wait();
171
184
  console.log(await rpc.nfts.getHousePrice(chainId, parseInt(id), provider));
172
185
  };
173
186
  const fulfillRequest = async () => {
@@ -197,3 +210,4 @@ const fulfillRequest = async () => {
197
210
  setup();
198
211
  // fulfillRequest();
199
212
  // setup();
213
+ // updateNFTPrice("9", "189400")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raac/rpc",
3
- "version": "1.1.0-beta.33",
3
+ "version": "1.1.0-beta.35",
4
4
  "description": "RPC Library for RAAC ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",