@molecularlabs/nucleus-frontend
Version:
Nucleus BoringVault Frontend SDK
74 lines • 2.33 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var multi_call_exports = {};
__export(multi_call_exports, {
getPausedStates: () => getPausedStates,
getRateInQuoteWithAssetDecimals: () => getRateInQuoteWithAssetDecimals
});
module.exports = __toCommonJS(multi_call_exports);
var import_viem = require("viem");
var import_accountant_abi = require("../contracts/accountant-abi");
var import_teller_abi = require("../contracts/teller-abi");
var import_client = require("../lib/client");
const getRateInQuoteWithAssetDecimals = async ({
assetAddress,
accountantAddress,
chainId
}) => {
const client = await (0, import_client.getClient)(chainId);
const results = await client.multicall({
contracts: [
{
abi: import_viem.erc20Abi,
address: assetAddress,
functionName: "decimals"
},
{
abi: import_accountant_abi.AccountantAbi,
address: accountantAddress,
functionName: "getRateInQuote",
args: [assetAddress]
}
]
});
return results;
};
const getPausedStates = async ({
accountantAddress,
tellerAddress,
chainId
}) => {
const client = await (0, import_client.getClient)(chainId);
const results = await client.multicall({
contracts: [
{
abi: import_teller_abi.TellerAbi,
address: tellerAddress,
functionName: "isPaused"
},
{
abi: import_accountant_abi.AccountantAbi,
address: accountantAddress,
functionName: "accountantState"
}
]
});
return results;
};
//# sourceMappingURL=multi-call.js.map