@raac/rpc 1.1.0-beta.55 → 1.1.0-beta.56

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.
@@ -6,6 +6,7 @@ const _helpers_1 = require("./_helpers");
6
6
  async function getWithdrawRequestInfo(chainId, userAddress, provider) {
7
7
  try {
8
8
  const stabilityPoolContract = await (0, _helpers_1.getStabilityPoolContract)(chainId, provider);
9
+ const duration = await stabilityPoolContract.withdrawTimelockDuration();
9
10
  const request = await stabilityPoolContract.withdrawTimelock(userAddress);
10
11
  if (request[0] === 0n) {
11
12
  return null;
@@ -13,7 +14,8 @@ async function getWithdrawRequestInfo(chainId, userAddress, provider) {
13
14
  return {
14
15
  amount: ethers_1.ethers.formatEther(request[0]),
15
16
  readyAt: Number(request[1]),
16
- expiresAt: Number(request[2])
17
+ expiresAt: Number(request[2]),
18
+ duration: Number(duration)
17
19
  };
18
20
  }
19
21
  catch (error) {
@@ -34,9 +34,6 @@ async function createWallet(mnemonic, provider) {
34
34
  }
35
35
  async function setup() {
36
36
  const rpc = new RPCLibrary_1.default();
37
- const error = rpc.errors.getErrorInfo("0xa9b65aba");
38
- console.log(error);
39
- return;
40
37
  const provider = await getProvider();
41
38
  const signer = await createWallet(TEST_MNEMONIC, provider);
42
39
  // const rpc = new RPCLibrary();
@@ -84,10 +81,9 @@ async function setup() {
84
81
  // console.log("Liquidity in the Mock Liquidity Pool", liquidity);
85
82
  // mint the current user 5 million irAAC
86
83
  console.log("Minting 5 million irAAC");
87
- await rpc.wallet.assets.approveAsset(chainId, "crvusd", await rpc.pools.rwaVault.getAdapterAddress(chainId, "crvusdadapter").address, "5000000", signer);
88
- const data = new ethers_1.ethers.AbiCoder().encode(["uint256"], [ethers_1.ethers.parseEther("5000000")]);
89
- await rpc.pools.rwaVault.depositToRWAVault(chainId, "crvusdadapter", data, signer.address, signer);
90
- return;
84
+ // await rpc.wallet.assets.approveAsset(chainId, "crvusd", await rpc.pools.rwaVault.getAdapterAddress(chainId, "crvusdadapter").address, "5000000", signer);
85
+ // const data = new ethers.AbiCoder().encode(["uint256"], [ ethers.parseEther("5000000") ])
86
+ // await rpc.pools.rwaVault.depositToRWAVault(chainId, "crvusdadapter", data, signer.address, signer)
91
87
  /// END OF ADD FUNDS IN THE MOCK LIQUIDITY POOL
92
88
  // // // send myself some CRVUSD
93
89
  // await rpc.wallet.assets.mintAsset(
@@ -4,6 +4,7 @@ interface WithdrawRequestInfo {
4
4
  amount: string;
5
5
  readyAt: number;
6
6
  expiresAt: number;
7
+ duration: number;
7
8
  }
8
9
  export declare function getWithdrawRequestInfo(chainId: ChainId, userAddress: string, provider: Provider): Promise<WithdrawRequestInfo | null>;
9
10
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raac/rpc",
3
- "version": "1.1.0-beta.55",
3
+ "version": "1.1.0-beta.56",
4
4
  "description": "RPC Library for RAAC ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",