UNPKG

@paxoslabs/earn-sdk

Version:
62 lines (59 loc) 2.01 kB
'use strict'; var chunkQON5Z6CB_js = require('./chunk-QON5Z6CB.js'); var chunkQ52QVNPZ_js = require('./chunk-Q52QVNPZ.js'); require('./chunk-TFV7VK2Y.js'); var chunk7FQRRMLO_js = require('./chunk-7FQRRMLO.js'); require('./chunk-NEVIH2LY.js'); require('./chunk-OTTVE2OX.js'); require('./chunk-U72Q2IH5.js'); // src/display/vault-status.ts var getVaultStatus = async ({ vaultKey, chainId }) => { const vault = await chunk7FQRRMLO_js.getVaultByKey(vaultKey); if (!vault) { throw new Error(`Vault not found: ${vaultKey}`); } const tellerAddress = vault.contracts.teller; const accountantAddress = vault.contracts.accountant; const [tellerStatus, accountantStatus] = await chunkQ52QVNPZ_js.getPausedStates({ accountantAddress, tellerAddress, chainId }); if (tellerStatus.status === "failure") { throw new Error(tellerStatus.error.message); } if (accountantStatus.status === "failure") { throw new Error(accountantStatus.error.message); } if (tellerStatus.result === true || accountantStatus.result[7] === true) { return { isPaused: true }; } return { isPaused: false }; }; Object.defineProperty(exports, "getBridgeFee", { enumerable: true, get: function () { return chunkQON5Z6CB_js.getBridgeFee; } }); Object.defineProperty(exports, "getDepositExchangeRate", { enumerable: true, get: function () { return chunkQON5Z6CB_js.getDepositExchangeRate; } }); Object.defineProperty(exports, "getWithdrawExchangeRate", { enumerable: true, get: function () { return chunkQON5Z6CB_js.getWithdrawExchangeRate; } }); Object.defineProperty(exports, "isDepositSpendApproved", { enumerable: true, get: function () { return chunkQON5Z6CB_js.isDepositSpendApproved; } }); Object.defineProperty(exports, "isWithdrawalSpendApproved", { enumerable: true, get: function () { return chunkQON5Z6CB_js.isWithdrawalSpendApproved; } }); exports.getVaultStatus = getVaultStatus; //# sourceMappingURL=display.js.map //# sourceMappingURL=display.js.map