@raac/rpc 1.1.0-beta.31 → 1.1.0-beta.32
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/dist/pools/rwaVault/_helpers.js +2 -3
- package/dist/pools/rwaVault/depositToRWAVault.js +1 -1
- package/dist/pools/rwaVault/getNextRandomNFT.js +1 -1
- package/dist/pools/rwaVault/getRWAVaultInfo.js +2 -5
- package/dist/pools/rwaVault/redeemNFTFromRWAVault.js +1 -1
- package/dist/pools/rwaVault/requestRandomSeed.js +1 -1
- package/dist/types/RPCLibrary.d.ts +1 -1
- package/dist/types/pools/rwaVault/_helpers.d.ts +2 -2
- package/dist/types/pools/rwaVault/getRWAVaultInfo.d.ts +2 -2
- package/package.json +1 -1
|
@@ -33,9 +33,8 @@ function getRWAVaultAdapterByAddress(chainId, address) {
|
|
|
33
33
|
throw new Error("Adapter not found in config.");
|
|
34
34
|
return adaptersConfig.rwavault[matchKey];
|
|
35
35
|
}
|
|
36
|
-
async function getRWAVaultContract(chainId) {
|
|
36
|
+
async function getRWAVaultContract(chainId, provider_signer) {
|
|
37
37
|
const rwaVaultAddress = (0, getContractAddress_1.default)(chainId, "rwavault");
|
|
38
38
|
const rwaVaultABI = (0, artifacts_1.getABI)("rwavault");
|
|
39
|
-
|
|
40
|
-
return new ethers_1.ethers.Contract(rwaVaultAddress, rwaVaultABI, provider);
|
|
39
|
+
return new ethers_1.ethers.Contract(rwaVaultAddress, rwaVaultABI, provider_signer);
|
|
41
40
|
}
|
|
@@ -6,7 +6,7 @@ async function depositToRWAVault(chainId, adapter, data, receiver, signer) {
|
|
|
6
6
|
throw new Error("Wallet not connected");
|
|
7
7
|
}
|
|
8
8
|
try {
|
|
9
|
-
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId);
|
|
9
|
+
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId, signer);
|
|
10
10
|
const tx = await rwaVaultContract.depositAsset(adapter, data, receiver, {
|
|
11
11
|
nonce: await signer.getNonce(),
|
|
12
12
|
});
|
|
@@ -6,7 +6,7 @@ async function getNextRandomNFT(chainId, signer) {
|
|
|
6
6
|
throw new Error("Wallet not connected");
|
|
7
7
|
}
|
|
8
8
|
try {
|
|
9
|
-
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId);
|
|
9
|
+
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId, signer);
|
|
10
10
|
const [adapter, tokenId] = await rwaVaultContract.getNextRandomNFT();
|
|
11
11
|
return {
|
|
12
12
|
adapter,
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const _helpers_1 = require("./_helpers");
|
|
4
|
-
async function getRWAVaultInfo(chainId,
|
|
5
|
-
if (!signer) {
|
|
6
|
-
throw new Error("Wallet not connected");
|
|
7
|
-
}
|
|
4
|
+
async function getRWAVaultInfo(chainId, provider) {
|
|
8
5
|
try {
|
|
9
|
-
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId);
|
|
6
|
+
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId, provider);
|
|
10
7
|
const [totalAssets, pricePerShare, vaultToken, underlyingAssetToken, stabilityPool, vrfConsumer, indexTokenMintingFee, feeCollector, vrfRequestDelay, allowVRFRequest, llamaTemple, llamaPerkDiscount, llamaPerkMultiplier, llamaPerkClassName] = await Promise.all([
|
|
11
8
|
rwaVaultContract.totalAssets(),
|
|
12
9
|
rwaVaultContract.pricePerShare(),
|
|
@@ -6,7 +6,7 @@ async function redeemNFTFromRWAVault(chainId, signer) {
|
|
|
6
6
|
throw new Error("Wallet not connected");
|
|
7
7
|
}
|
|
8
8
|
try {
|
|
9
|
-
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId);
|
|
9
|
+
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId, signer);
|
|
10
10
|
const tx = await rwaVaultContract.redeemNFT({
|
|
11
11
|
nonce: await signer.getNonce(),
|
|
12
12
|
});
|
|
@@ -6,7 +6,7 @@ async function requestRandomSeed(chainId, signer) {
|
|
|
6
6
|
throw new Error("Wallet not connected");
|
|
7
7
|
}
|
|
8
8
|
try {
|
|
9
|
-
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId);
|
|
9
|
+
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId, signer);
|
|
10
10
|
const tx = await rwaVaultContract.requestRandomSeed({
|
|
11
11
|
nonce: await signer.getNonce(),
|
|
12
12
|
});
|
|
@@ -232,7 +232,7 @@ declare class RPCLibrary {
|
|
|
232
232
|
setChainsConfig: typeof setChainConfig;
|
|
233
233
|
constructor(privateKey?: string);
|
|
234
234
|
getWallet(privateKey: string, provider: Provider): Promise<ethers.JsonRpcSigner | ethers.Wallet>;
|
|
235
|
-
getProvider(chainId: ChainId, providerRpc?: string): Promise<ethers.
|
|
235
|
+
getProvider(chainId: ChainId, providerRpc?: string): Promise<ethers.BrowserProvider | ethers.JsonRpcProvider>;
|
|
236
236
|
getSigner(chainId: ChainId, address: string): Promise<ethers.JsonRpcSigner>;
|
|
237
237
|
connectWallet(): Promise<void>;
|
|
238
238
|
checkConnection(): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BytesLike, ethers } from "ethers";
|
|
1
|
+
import { BytesLike, ethers, Provider, Signer } from "ethers";
|
|
2
2
|
import { ChainId } from "../../configs/chains";
|
|
3
3
|
import { Adapter } from "../../configs/chains/chain";
|
|
4
4
|
import { RWAVault } from "../../typechain-types";
|
|
@@ -7,4 +7,4 @@ export declare function decodeERC721(data: BytesLike): ethers.Result;
|
|
|
7
7
|
export declare function encodeERC20(amount: string): string;
|
|
8
8
|
export declare function decodeERC20(data: BytesLike): bigint;
|
|
9
9
|
export declare function getRWAVaultAdapterByAddress(chainId: ChainId, address: string): Adapter;
|
|
10
|
-
export declare function getRWAVaultContract(chainId: ChainId): Promise<RWAVault>;
|
|
10
|
+
export declare function getRWAVaultContract(chainId: ChainId, provider_signer?: Provider | Signer): Promise<RWAVault>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
2
|
import { ChainId } from "../../configs/chains/index";
|
|
3
3
|
interface RWAVaultInfo {
|
|
4
4
|
totalAssets: string;
|
|
@@ -16,5 +16,5 @@ interface RWAVaultInfo {
|
|
|
16
16
|
llamaPerkMultiplier: string;
|
|
17
17
|
llamaPerkClassName: string;
|
|
18
18
|
}
|
|
19
|
-
declare function getRWAVaultInfo(chainId: ChainId,
|
|
19
|
+
declare function getRWAVaultInfo(chainId: ChainId, provider: Provider): Promise<RWAVaultInfo>;
|
|
20
20
|
export default getRWAVaultInfo;
|