@raac/rpc 1.1.0-beta.20 → 1.1.0-beta.21
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/lendingPool/adapters/erc721/getERC721AdapterDeposits.js +4 -3
- package/dist/pools/lendingPool/adapters/erc721/getERC721AdapterInfo.js +4 -3
- package/dist/types/pools/lendingPool/adapters/erc721/getERC721AdapterDeposits.d.ts +4 -2
- package/dist/types/pools/lendingPool/adapters/erc721/getERC721AdapterInfo.d.ts +4 -2
- package/package.json +1 -1
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ethers_1 = require("ethers");
|
|
4
4
|
const artifacts_1 = require("../../../../utils/artifacts");
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const getAdapterAddress_1 = require("../../getAdapterAddress");
|
|
6
|
+
async function getERC721AdapterDeposits(chainId, adapterName, userAddress, provider) {
|
|
7
|
+
if (!provider) {
|
|
7
8
|
throw new Error("Wallet not connected");
|
|
8
9
|
}
|
|
9
10
|
try {
|
|
10
11
|
const abi = (0, artifacts_1.getABI)("erc721assetadapter");
|
|
11
|
-
const adapterContract = new ethers_1.ethers.Contract(
|
|
12
|
+
const adapterContract = new ethers_1.ethers.Contract((0, getAdapterAddress_1.getAdapterAddressOnly)(chainId, adapterName), abi, provider);
|
|
12
13
|
const depositedTokens = await adapterContract.getDepositedTokens(userAddress);
|
|
13
14
|
return depositedTokens;
|
|
14
15
|
}
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ethers_1 = require("ethers");
|
|
4
4
|
const artifacts_1 = require("../../../../utils/artifacts");
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const getAdapterAddress_1 = require("../../getAdapterAddress");
|
|
6
|
+
async function getERC721AdapterInfo(chainId, adapterName, provider) {
|
|
7
|
+
if (!provider) {
|
|
7
8
|
throw new Error("Wallet not connected");
|
|
8
9
|
}
|
|
9
10
|
try {
|
|
10
11
|
const abi = (0, artifacts_1.getABI)("erc721assetadapter");
|
|
11
|
-
const adapterContract = new ethers_1.ethers.Contract(
|
|
12
|
+
const adapterContract = new ethers_1.ethers.Contract((0, getAdapterAddress_1.getAdapterAddressOnly)(chainId, adapterName), abi, provider);
|
|
12
13
|
const [token, priceOracle, lendingPool, assetType, supportsPartialWithdraw] = await Promise.all([
|
|
13
14
|
adapterContract.token(),
|
|
14
15
|
adapterContract.priceOracle(),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { LendingPoolAdapterId } from "../../types";
|
|
3
|
+
import { ChainId } from "../../../../configs/chains";
|
|
4
|
+
declare function getERC721AdapterDeposits(chainId: ChainId, adapterName: LendingPoolAdapterId, userAddress: string, provider: Provider): Promise<bigint[]>;
|
|
3
5
|
export default getERC721AdapterDeposits;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../../../configs/chains";
|
|
3
|
+
import { LendingPoolAdapterId } from "../../types";
|
|
2
4
|
interface ERC721AdapterInfo {
|
|
3
5
|
token: string;
|
|
4
6
|
priceOracle: string;
|
|
@@ -6,5 +8,5 @@ interface ERC721AdapterInfo {
|
|
|
6
8
|
assetType: string;
|
|
7
9
|
supportsPartialWithdraw: boolean;
|
|
8
10
|
}
|
|
9
|
-
declare function getERC721AdapterInfo(
|
|
11
|
+
declare function getERC721AdapterInfo(chainId: ChainId, adapterName: LendingPoolAdapterId, provider: Provider): Promise<ERC721AdapterInfo>;
|
|
10
12
|
export default getERC721AdapterInfo;
|