@berachain/berajs 0.2.8-beta.1 → 0.2.8-beta.11
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/RequestError-BRIiJgHk.d.ts +144 -0
- package/dist/RequestError-DSUzJ1Iy.d.cts +144 -0
- package/dist/abi/exports.cjs.map +1 -1
- package/dist/abi/exports.mjs +1 -1
- package/dist/actions/exports.cjs +1 -1
- package/dist/actions/exports.cjs.map +1 -1
- package/dist/actions/exports.d.cts +22 -105
- package/dist/actions/exports.d.ts +22 -105
- package/dist/actions/exports.mjs +1 -1
- package/dist/actions/exports.mjs.map +1 -1
- package/dist/actions/governance/exports.cjs +2 -0
- package/dist/actions/governance/exports.cjs.map +1 -0
- package/dist/actions/governance/exports.d.cts +140 -0
- package/dist/actions/governance/exports.d.ts +140 -0
- package/dist/actions/governance/exports.mjs +2 -0
- package/dist/actions/governance/exports.mjs.map +1 -0
- package/dist/chunk-33XNWMPP.cjs +2 -0
- package/dist/chunk-33XNWMPP.cjs.map +1 -0
- package/dist/chunk-4TALWNXE.cjs +2 -0
- package/dist/chunk-4TALWNXE.cjs.map +1 -0
- package/dist/chunk-54BTOQE3.cjs +2 -0
- package/dist/chunk-54BTOQE3.cjs.map +1 -0
- package/dist/chunk-5QAFKFM5.mjs +2 -0
- package/dist/chunk-5QAFKFM5.mjs.map +1 -0
- package/dist/chunk-6DIA6PXV.cjs +2 -0
- package/dist/chunk-6DIA6PXV.cjs.map +1 -0
- package/dist/{chunk-NMH7LHPW.cjs → chunk-6JJIZCVY.cjs} +2 -2
- package/dist/chunk-6JJIZCVY.cjs.map +1 -0
- package/dist/chunk-BE6B4PQF.cjs +2 -0
- package/dist/chunk-BE6B4PQF.cjs.map +1 -0
- package/dist/chunk-CHFETMC6.cjs +4 -0
- package/dist/chunk-CHFETMC6.cjs.map +1 -0
- package/dist/{chunk-I7M43BB4.cjs → chunk-D6L7LTA2.cjs} +2 -2
- package/dist/chunk-D6L7LTA2.cjs.map +1 -0
- package/dist/chunk-DDEQFR3M.cjs.map +1 -1
- package/dist/chunk-ENT2OSXT.mjs +2 -0
- package/dist/chunk-ENT2OSXT.mjs.map +1 -0
- package/dist/{chunk-74QD4JAH.mjs → chunk-GXV2JA36.mjs} +2 -2
- package/dist/chunk-GXV2JA36.mjs.map +1 -0
- package/dist/chunk-H6ZO4SLB.mjs +4 -0
- package/dist/chunk-H6ZO4SLB.mjs.map +1 -0
- package/dist/chunk-JDDRTHFG.mjs +2 -0
- package/dist/chunk-JDDRTHFG.mjs.map +1 -0
- package/dist/{chunk-T5FSQ3YE.mjs → chunk-JDZGYU5T.mjs} +2 -2
- package/dist/{chunk-T5FSQ3YE.mjs.map → chunk-JDZGYU5T.mjs.map} +1 -1
- package/dist/chunk-JIPSTWKO.mjs +2 -0
- package/dist/{chunk-KI66MQ43.mjs.map → chunk-JIPSTWKO.mjs.map} +1 -1
- package/dist/chunk-JSTCUTXP.cjs +2 -0
- package/dist/chunk-JSTCUTXP.cjs.map +1 -0
- package/dist/{chunk-MJZHJFZO.mjs → chunk-JXM5S4IU.mjs} +2 -2
- package/dist/chunk-K5L2B4DU.mjs +2 -0
- package/dist/{chunk-EFG3OYYQ.mjs.map → chunk-K5L2B4DU.mjs.map} +1 -1
- package/dist/chunk-KUQEX7H3.mjs +2 -0
- package/dist/chunk-KUQEX7H3.mjs.map +1 -0
- package/dist/chunk-NXXMW2O7.mjs +2 -0
- package/dist/chunk-NXXMW2O7.mjs.map +1 -0
- package/dist/chunk-OIYXOKTT.cjs.map +1 -1
- package/dist/chunk-OUD27MU7.cjs.map +1 -1
- package/dist/chunk-PRLVZIKD.mjs +2 -0
- package/dist/chunk-PRLVZIKD.mjs.map +1 -0
- package/dist/chunk-QVIAMSZ6.cjs +2 -0
- package/dist/chunk-QVIAMSZ6.cjs.map +1 -0
- package/dist/chunk-RCWM55DE.cjs +2 -0
- package/dist/chunk-RCWM55DE.cjs.map +1 -0
- package/dist/chunk-REWME3FY.cjs +2 -0
- package/dist/chunk-REWME3FY.cjs.map +1 -0
- package/dist/chunk-RJN36GBU.mjs +2 -0
- package/dist/chunk-RJN36GBU.mjs.map +1 -0
- package/dist/chunk-RWOICHRW.cjs.map +1 -1
- package/dist/chunk-S4CDSVLK.cjs +2 -0
- package/dist/chunk-S4CDSVLK.cjs.map +1 -0
- package/dist/chunk-WLJHFHKF.mjs +2 -0
- package/dist/chunk-WLJHFHKF.mjs.map +1 -0
- package/dist/chunk-WRFDB3QJ.cjs.map +1 -1
- package/dist/chunk-XNJLSA6P.cjs.map +1 -1
- package/dist/chunk-XZC34BHM.cjs +2 -0
- package/dist/chunk-XZC34BHM.cjs.map +1 -0
- package/dist/chunk-Y2FETC6T.cjs +2 -0
- package/dist/chunk-Y2FETC6T.cjs.map +1 -0
- package/dist/chunk-ZW2N63FI.mjs +2 -0
- package/dist/chunk-ZW2N63FI.mjs.map +1 -0
- package/dist/contexts/exports.cjs +1 -1
- package/dist/contexts/exports.cjs.map +1 -1
- package/dist/contexts/exports.mjs +1 -1
- package/dist/contexts/exports.mjs.map +1 -1
- package/dist/enum/exports.cjs +1 -1
- package/dist/enum/exports.cjs.map +1 -1
- package/dist/enum/exports.d.cts +1 -1
- package/dist/enum/exports.d.ts +1 -1
- package/dist/enum/exports.mjs +1 -1
- package/dist/enum/exports.mjs.map +1 -1
- package/dist/enum/governance/exports.cjs +2 -0
- package/dist/enum/governance/exports.cjs.map +1 -0
- package/dist/enum/governance/exports.d.cts +60 -0
- package/dist/enum/governance/exports.d.ts +60 -0
- package/dist/enum/governance/exports.mjs +2 -0
- package/dist/enum/governance/exports.mjs.map +1 -0
- package/dist/errors/exports.cjs +1 -1
- package/dist/errors/exports.cjs.map +1 -1
- package/dist/errors/exports.d.cts +3 -89
- package/dist/errors/exports.d.ts +3 -89
- package/dist/errors/exports.mjs +1 -1
- package/dist/{getValidatorQueuedOperatorAddress-BQXkSFd9.d.cts → getValidatorQueuedOperatorAddress-CPuIw7n5.d.cts} +2 -2
- package/dist/{getValidatorQueuedOperatorAddress-DUZOmxLV.d.ts → getValidatorQueuedOperatorAddress-CbZQ0kv2.d.ts} +2 -2
- package/dist/{global.d-6aSWIkV_.d.cts → global.d-B9nLZ7ul.d.cts} +3 -239
- package/dist/{global.d-SU9Epq0M.d.ts → global.d-ylUk_etZ.d.ts} +3 -239
- package/dist/hooks/exports.cjs +3 -3
- package/dist/hooks/exports.cjs.map +1 -1
- package/dist/hooks/exports.d.cts +19 -198
- package/dist/hooks/exports.d.ts +19 -198
- package/dist/hooks/exports.mjs +3 -3
- package/dist/hooks/exports.mjs.map +1 -1
- package/dist/hooks/governance/exports.cjs +2 -0
- package/dist/hooks/governance/exports.cjs.map +1 -0
- package/dist/hooks/governance/exports.d.cts +181 -0
- package/dist/hooks/governance/exports.d.ts +181 -0
- package/dist/hooks/governance/exports.mjs +2 -0
- package/dist/hooks/governance/exports.mjs.map +1 -0
- package/dist/pol.d-o6Iw75bK.d.cts +134 -0
- package/dist/pol.d-qR8bGEP5.d.ts +134 -0
- package/dist/{txnEnum-CCuQUFlh.d.cts → txnEnum-CwAJN4zV.d.cts} +3 -60
- package/dist/{txnEnum-CCuQUFlh.d.ts → txnEnum-CwAJN4zV.d.ts} +3 -60
- package/dist/types/exports.cjs.map +1 -1
- package/dist/types/exports.d.cts +7 -7
- package/dist/types/exports.d.ts +7 -7
- package/dist/types/governance/exports.cjs +1 -0
- package/dist/types/governance/exports.cjs.map +1 -0
- package/dist/types/governance/exports.d.cts +109 -0
- package/dist/types/governance/exports.d.ts +109 -0
- package/dist/types/governance/exports.mjs +1 -0
- package/dist/types/governance/exports.mjs.map +1 -0
- package/dist/utils/exports.cjs +1 -1
- package/dist/utils/exports.cjs.map +1 -1
- package/dist/utils/exports.d.cts +10 -2
- package/dist/utils/exports.d.ts +10 -2
- package/dist/utils/exports.mjs +1 -1
- package/dist/utils/exports.mjs.map +1 -1
- package/package.json +49 -8
- package/src/actions/clients/BeraApolloClient.ts +9 -0
- package/src/actions/clients/getApolloClient.ts +23 -6
- package/src/actions/dex/getOnChainPool.ts +1 -1
- package/src/actions/enso/getBendMultiplyBundle.ts +9 -2
- package/src/actions/enso/util.ts +6 -8
- package/src/actions/exports.ts +1 -10
- package/src/actions/governance/checkProposalField.ts +108 -54
- package/src/actions/governance/computeActualStatus.ts +7 -3
- package/src/actions/governance/exports.ts +9 -0
- package/src/actions/governance/getAllProposals.ts +15 -8
- package/src/actions/governance/getBodyErrors.ts +13 -5
- package/src/actions/governance/getDecodedFunctionData.ts +31 -22
- package/src/actions/governance/getProposalDetails.ts +8 -4
- package/src/actions/governance/getProposalFromTx.ts +19 -10
- package/src/actions/governance/getProposalParams.ts +17 -17
- package/src/actions/governance/getProposalVotes.ts +7 -3
- package/src/actions/governance/getQuorum.ts +7 -7
- package/src/actions/governance/parseProposalBody.ts +19 -9
- package/src/actions/honey/getChartData.ts +5 -5
- package/src/actions/honey/getHoney24hVolume.ts +30 -0
- package/src/actions/honey/getHoneyPythPriceOracle.ts +1 -1
- package/src/actions/honey/getHoneyRootPriceOracle.ts +1 -1
- package/src/actions/pol/getEarnedStakedBeraVault.ts +12 -2
- package/src/actions/pol/getRewardVaultBeaconImplementation.ts +1 -1
- package/src/actions/pol/getRewardVaultIncentives.ts +2 -2
- package/src/actions/pol/getStakingDailyAssets.ts +7 -1
- package/src/actions/pol/getTotalStakedAmount.ts +1 -1
- package/src/actions/pol/getUserClaimableIncentives.ts +1 -1
- package/src/actions/pol/getUserVaultsReward.ts +1 -1
- package/src/actions/tokens/getTokenInformation.ts +8 -15
- package/src/actions/tokens/getUnderlyingToken.ts +1 -1
- package/src/actions/validators/getUserBoosts.ts +1 -1
- package/src/enum/exports.ts +0 -1
- package/src/enum/governance/exports.ts +1 -0
- package/src/enum/txnEnum.ts +2 -0
- package/src/errors/BeraError.ts +7 -2
- package/src/errors/RequestError.ts +2 -1
- package/src/hooks/dex/usePoolHistoricalData.ts +1 -1
- package/src/hooks/enso/useBendZapSupply.ts +1 -1
- package/src/hooks/exports.ts +1 -15
- package/src/hooks/governance/exports.ts +14 -0
- package/src/hooks/honey/useHoney24hVolume.ts +16 -0
- package/src/hooks/perps/usePythUpdateFee.ts +1 -1
- package/src/hooks/validators/useValidatorRewardAllocation.ts +1 -1
- package/src/types/exports.ts +0 -1
- package/src/types/governance/exports.ts +1 -0
- package/src/utils/beraFetch.ts +70 -15
- package/src/utils/getErrorResponse.ts +1 -1
- package/dist/RequestError-A8XJ6QR9.d.cts +0 -57
- package/dist/RequestError-Dk97z8rm.d.ts +0 -57
- package/dist/chunk-2EN6PPAW.cjs +0 -2
- package/dist/chunk-2EN6PPAW.cjs.map +0 -1
- package/dist/chunk-2YBHAMDV.cjs +0 -2
- package/dist/chunk-2YBHAMDV.cjs.map +0 -1
- package/dist/chunk-57RINXU6.cjs +0 -2
- package/dist/chunk-57RINXU6.cjs.map +0 -1
- package/dist/chunk-74QD4JAH.mjs.map +0 -1
- package/dist/chunk-74WA35RI.cjs +0 -2
- package/dist/chunk-74WA35RI.cjs.map +0 -1
- package/dist/chunk-7ITWLMO7.cjs +0 -4
- package/dist/chunk-7ITWLMO7.cjs.map +0 -1
- package/dist/chunk-BEKH5EYT.mjs +0 -2
- package/dist/chunk-BEKH5EYT.mjs.map +0 -1
- package/dist/chunk-DK42F2ZM.cjs +0 -2
- package/dist/chunk-DK42F2ZM.cjs.map +0 -1
- package/dist/chunk-EFG3OYYQ.mjs +0 -2
- package/dist/chunk-GO5E7UUD.cjs +0 -2
- package/dist/chunk-GO5E7UUD.cjs.map +0 -1
- package/dist/chunk-I7M43BB4.cjs.map +0 -1
- package/dist/chunk-IDFMLLDY.mjs +0 -2
- package/dist/chunk-IDFMLLDY.mjs.map +0 -1
- package/dist/chunk-JE5GI2OC.mjs +0 -4
- package/dist/chunk-JE5GI2OC.mjs.map +0 -1
- package/dist/chunk-KI66MQ43.mjs +0 -2
- package/dist/chunk-NMH7LHPW.cjs.map +0 -1
- package/dist/chunk-NVHV2LDK.cjs +0 -2
- package/dist/chunk-NVHV2LDK.cjs.map +0 -1
- package/dist/chunk-PLIH6KQM.mjs +0 -2
- package/dist/chunk-PLIH6KQM.mjs.map +0 -1
- package/dist/chunk-QRAIGQF2.mjs +0 -2
- package/dist/chunk-QRAIGQF2.mjs.map +0 -1
- package/src/actions/honey/getHoneyGlobalData.ts +0 -21
- package/src/hooks/honey/useHoneyGlobalData.ts +0 -23
- /package/dist/{chunk-MJZHJFZO.mjs.map → chunk-JXM5S4IU.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/contexts/SwrFallback.tsx"],"sourcesContent":["import type React from \"react\";\nimport { useEffect } from \"react\";\nimport { SWRConfig } from \"swr\";\n\nimport { BeraError } from \"../errors/BeraError\";\nimport { BeraMonitoring } from \"../errors/BeraMonitoring\";\n\nexport function SWRFallback({\n fallback,\n children,\n}: {\n fallback: Record<string, any>;\n children: React.ReactNode;\n}) {\n useEffect(() => {\n Object.entries(fallback).some(([key, value]) => {\n if (!key) {\n console.warn(\"SWRFallback\", key, value);\n BeraMonitoring.captureException(\n new BeraError({\n message:\n \"Empty key in SWRFallback. This will lead to wrong query returns when key is null. Should be reported to SWR.\",\n level: \"warning\",\n extra: {\n key,\n value,\n },\n }),\n );\n return true;\n } else return false;\n });\n }, [fallback]);\n\n return (\n <SWRConfig\n value={{\n fallback,\n }}\n >\n {children}\n </SWRConfig>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/contexts/SwrFallback.tsx"],"sourcesContent":["import type React from \"react\";\nimport { useEffect } from \"react\";\nimport { SWRConfig } from \"swr\";\n\nimport { BeraError } from \"../errors/BeraError\";\nimport { BeraMonitoring } from \"../errors/BeraMonitoring\";\n\nexport function SWRFallback({\n fallback,\n children,\n}: {\n fallback: Record<string, any>;\n children: React.ReactNode;\n}) {\n useEffect(() => {\n Object.entries(fallback).some(([key, value]) => {\n if (!key) {\n console.warn(\"SWRFallback\", key, value);\n BeraMonitoring.captureException(\n new BeraError({\n message:\n \"Empty key in SWRFallback. This will lead to wrong query returns when key is null. Should be reported to SWR.\",\n level: \"warning\",\n extra: {\n key,\n value,\n },\n }),\n );\n return true;\n } else return false;\n });\n }, [fallback]);\n\n return (\n <SWRConfig\n value={{\n fallback,\n }}\n >\n {children}\n </SWRConfig>\n );\n}\n"],"mappings":"wbACA,OAAS,aAAAA,MAAiB,QAC1B,OAAS,aAAAC,MAAiB,MAiCtB,cAAAC,MAAA,oBA5BG,SAASC,EAAY,CAC1B,SAAAC,EACA,SAAAC,CACF,EAGG,CACD,OAAAC,EAAU,IAAM,CACd,OAAO,QAAQF,CAAQ,EAAE,KAAK,CAAC,CAACG,EAAKC,CAAK,IACnCD,EAcS,IAbZ,QAAQ,KAAK,cAAeA,EAAKC,CAAK,EACtCC,EAAe,iBACb,IAAIC,EAAU,CACZ,QACE,+GACF,MAAO,UACP,MAAO,CACL,IAAAH,EACA,MAAAC,CACF,CACF,CAAC,CACH,EACO,GAEV,CACH,EAAG,CAACJ,CAAQ,CAAC,EAGXF,EAACS,EAAA,CACC,MAAO,CACL,SAAAP,CACF,EAEC,SAAAC,EACH,CAEJ","names":["useEffect","SWRConfig","jsx","SWRFallback","fallback","children","useEffect","key","value","BeraMonitoring","BeraError","SWRConfig"]}
|
package/dist/enum/exports.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD6L7LTA2cjs = require('../chunk-D6L7LTA2.cjs');var _chunkXNJLSA6Pcjs = require('../chunk-XNJLSA6P.cjs');var u=.5,a= exports.SLIPPAGE_DEGEN_VALUE =25,i= exports.DEFAULT_DEADLINE =60,t= exports.SLIPPAGE_MODE =(o=>(o.AUTO="auto",o.CUSTOM="custom",o.DEGEN="degen",o))(t||{}),r= exports.TRANSACTION_MODE =(o=>(o.AUTO="auto",o.CUSTOM="custom",o.INFINITY="infinity",o))(r||{});exports.Aggregators = _chunkD6L7LTA2cjs.e; exports.ContractName = _chunkD6L7LTA2cjs.a; exports.DEFAULT_DEADLINE = i; exports.DEFAULT_SLIPPAGE = u; exports.HoneySwapAction = _chunkD6L7LTA2cjs.g; exports.OwnershipType = _chunkD6L7LTA2cjs.b; exports.POLLING = _chunkXNJLSA6Pcjs.a; exports.ParameterPreset = _chunkD6L7LTA2cjs.c; exports.PoolCreationStep = _chunkD6L7LTA2cjs.d; exports.SLIPPAGE_DEGEN_VALUE = a; exports.SLIPPAGE_MODE = t; exports.SwapReferrer = _chunkD6L7LTA2cjs.f; exports.TRANSACTION_MODE = r; exports.TransactionActionType = _chunkD6L7LTA2cjs.h;
|
|
2
2
|
//# sourceMappingURL=exports.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/liammcaweeney/Work/bera/monobera/packages/berajs/dist/enum/exports.cjs","../../src/enum/slippage.ts"],"names":["DEFAULT_SLIPPAGE","SLIPPAGE_DEGEN_VALUE","DEFAULT_DEADLINE","SLIPPAGE_MODE","TRANSACTION_MODE"],"mappings":"AAAA,kIAA0F,yDAA0C,ICAvHA,CAAAA,CAAmB,EAAA,CACnBC,CAAAA,gCAAuB,EAAA,CAKvBC,CAAAA,4BAAmB,EAAA,CAEpBC,CAAAA,yBAAAA,CAAAA,CAAAA,EAAAA,CACVA,CAAAA,CAAA,IAAA,CAAO,MAAA,CACPA,CAAAA,CAAA,MAAA,CAAS,QAAA,CACTA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CAHEA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAA,CAAA,CAAA,CAAA,CAMAC,CAAAA,4BAAAA,CAAAA,CAAAA,EAAAA,CACVA,CAAAA,CAAA,IAAA,CAAO,MAAA,CACPA,CAAAA,CAAA,MAAA,CAAS,QAAA,CACTA,CAAAA,CAAA,QAAA,CAAW,UAAA,CAHDA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAA,CAAA,CAAA,CAAA,CAAA,gjBAAA","file":"/Users/liammcaweeney/Work/bera/monobera/packages/berajs/dist/enum/exports.cjs","sourcesContent":[null,"export const DEFAULT_SLIPPAGE = 0.5 as const; // 2%\nexport const SLIPPAGE_DEGEN_VALUE = 25 as const; // 25%\n\n/**\n * Default\n */\nexport const DEFAULT_DEADLINE = 60 as const; // seconds\n\nexport enum SLIPPAGE_MODE {\n AUTO = \"auto\",\n CUSTOM = \"custom\",\n DEGEN = \"degen\",\n}\n\nexport enum TRANSACTION_MODE {\n AUTO = \"auto\",\n CUSTOM = \"custom\",\n INFINITY = \"infinity\",\n}\n"]}
|
package/dist/enum/exports.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as ContractName,
|
|
1
|
+
export { C as ContractName, T as TransactionActionType } from '../txnEnum-CwAJN4zV.cjs';
|
|
2
2
|
export { A as Aggregators, O as OwnershipType, P as ParameterPreset, a as PoolCreationStep, S as SwapReferrer } from '../dex-C_BB0b0O.cjs';
|
|
3
3
|
export { H as HoneySwapAction } from '../honey-CYm0RWf4.cjs';
|
|
4
4
|
export { P as POLLING } from '../polling-BKnyavLI.cjs';
|
package/dist/enum/exports.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as ContractName,
|
|
1
|
+
export { C as ContractName, T as TransactionActionType } from '../txnEnum-CwAJN4zV.js';
|
|
2
2
|
export { A as Aggregators, O as OwnershipType, P as ParameterPreset, a as PoolCreationStep, S as SwapReferrer } from '../dex-C_BB0b0O.js';
|
|
3
3
|
export { H as HoneySwapAction } from '../honey-CYm0RWf4.js';
|
|
4
4
|
export { P as POLLING } from '../polling-BKnyavLI.js';
|
package/dist/enum/exports.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as n,b as p,c as s,d as x,e as m,f as c,g as f,h as U}from"../chunk-JDZGYU5T.mjs";import{a as e}from"../chunk-575OK77P.mjs";var u=.5,a=25,i=60,t=(o=>(o.AUTO="auto",o.CUSTOM="custom",o.DEGEN="degen",o))(t||{}),r=(o=>(o.AUTO="auto",o.CUSTOM="custom",o.INFINITY="infinity",o))(r||{});export{m as Aggregators,n as ContractName,i as DEFAULT_DEADLINE,u as DEFAULT_SLIPPAGE,f as HoneySwapAction,p as OwnershipType,e as POLLING,s as ParameterPreset,x as PoolCreationStep,a as SLIPPAGE_DEGEN_VALUE,t as SLIPPAGE_MODE,c as SwapReferrer,r as TRANSACTION_MODE,U as TransactionActionType};
|
|
2
2
|
//# sourceMappingURL=exports.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/enum/slippage.ts"],"sourcesContent":["export const DEFAULT_SLIPPAGE = 0.5 as const; // 2%\nexport const SLIPPAGE_DEGEN_VALUE = 25 as const; // 25%\n\n/**\n * Default\n */\nexport const DEFAULT_DEADLINE = 60 as const; // seconds\n\nexport enum SLIPPAGE_MODE {\n AUTO = \"auto\",\n CUSTOM = \"custom\",\n DEGEN = \"degen\",\n}\n\nexport enum TRANSACTION_MODE {\n AUTO = \"auto\",\n CUSTOM = \"custom\",\n INFINITY = \"infinity\",\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/enum/slippage.ts"],"sourcesContent":["export const DEFAULT_SLIPPAGE = 0.5 as const; // 2%\nexport const SLIPPAGE_DEGEN_VALUE = 25 as const; // 25%\n\n/**\n * Default\n */\nexport const DEFAULT_DEADLINE = 60 as const; // seconds\n\nexport enum SLIPPAGE_MODE {\n AUTO = \"auto\",\n CUSTOM = \"custom\",\n DEGEN = \"degen\",\n}\n\nexport enum TRANSACTION_MODE {\n AUTO = \"auto\",\n CUSTOM = \"custom\",\n INFINITY = \"infinity\",\n}\n"],"mappings":"qIAAO,IAAMA,EAAmB,GACnBC,EAAuB,GAKvBC,EAAmB,GAEpBC,OACVA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,MAAQ,QAHEA,OAAA,IAMAC,OACVA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,SAAW,WAHDA,OAAA","names":["DEFAULT_SLIPPAGE","SLIPPAGE_DEGEN_VALUE","DEFAULT_DEADLINE","SLIPPAGE_MODE","TRANSACTION_MODE"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWRFDB3QJcjs = require('../../chunk-WRFDB3QJ.cjs');exports.ProposalErrorCodes = _chunkWRFDB3QJcjs.c; exports.ProposalState = _chunkWRFDB3QJcjs.a; exports.ProposalTypeEnum = _chunkWRFDB3QJcjs.d; exports.VoteColorMap = _chunkWRFDB3QJcjs.e; exports.VoteEnum = _chunkWRFDB3QJcjs.b;
|
|
2
|
+
//# sourceMappingURL=exports.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/liammcaweeney/Work/bera/monobera/packages/berajs/dist/enum/governance/exports.cjs"],"names":[],"mappings":"AAAA,qIAAwE,kOAAyG","file":"/Users/liammcaweeney/Work/bera/monobera/packages/berajs/dist/enum/governance/exports.cjs"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps the proposal state from the governor contract to a more human-readable format.
|
|
3
|
+
* Don't edit this enum manually, it's synced with the governor contract.
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/IGovernor.sol
|
|
6
|
+
*/
|
|
7
|
+
declare enum ProposalState {
|
|
8
|
+
Pending = 0,
|
|
9
|
+
Active = 1,
|
|
10
|
+
Canceled = 2,
|
|
11
|
+
Defeated = 3,
|
|
12
|
+
Succeeded = 4,
|
|
13
|
+
Queued = 5,
|
|
14
|
+
Expired = 6,
|
|
15
|
+
Executed = 7
|
|
16
|
+
}
|
|
17
|
+
declare enum VoteEnum {
|
|
18
|
+
AGAINST = "no",
|
|
19
|
+
FOR = "yes",
|
|
20
|
+
ABSTAIN = "abstain"
|
|
21
|
+
}
|
|
22
|
+
declare enum ProposalErrorCodes {
|
|
23
|
+
REQUIRED = "Required",
|
|
24
|
+
INVALID_AMOUNT = "Invalid amount",
|
|
25
|
+
NEGATIVE_AMOUNT = "Negative amount",
|
|
26
|
+
INVALID_ADDRESS = "Invalid address",
|
|
27
|
+
INVALID_ACTION = "Invalid action",
|
|
28
|
+
INVALID_ABI = "Invalid ABI",
|
|
29
|
+
MUST_BE_HTTPS = "Must be HTTPS",
|
|
30
|
+
MUST_BE_HTTPS_OR_IPFS = "Must be HTTPS or IPFS",
|
|
31
|
+
INVALID_BASEPATH = "Must be a berachain forum link",
|
|
32
|
+
/**
|
|
33
|
+
* Mainly used when it's not a reward vault
|
|
34
|
+
*/
|
|
35
|
+
INVALID_CONTRACT = "This is not a valid contract"
|
|
36
|
+
}
|
|
37
|
+
declare enum ProposalTypeEnum {
|
|
38
|
+
CUSTOM_PROPOSAL = "custom-action",
|
|
39
|
+
WHITELIST_REWARD_VAULT = "whitelist-reward-vault",
|
|
40
|
+
BLACKLIST_REWARD_VAULT = "blacklist-reward-vault",
|
|
41
|
+
ERC20_TRANSFER = "erc20-transfer",
|
|
42
|
+
WHITELIST_REWARD_VAULT_INCENTIVE = "whitelist-reward-vault-incentive"
|
|
43
|
+
}
|
|
44
|
+
declare const VoteColorMap: {
|
|
45
|
+
readonly yes: "#059669";
|
|
46
|
+
readonly 1: "#059669";
|
|
47
|
+
readonly no: "#DC2629";
|
|
48
|
+
readonly 2: "#DC2629";
|
|
49
|
+
readonly veto: "#0284C7";
|
|
50
|
+
readonly 4: "#0284C7";
|
|
51
|
+
readonly abstain: "#78716c";
|
|
52
|
+
readonly 3: "#78716c";
|
|
53
|
+
readonly yes_secondary: "#ECFDF5";
|
|
54
|
+
readonly no_secondary: "#FEF2F2";
|
|
55
|
+
readonly veto_secondary: "#F0F9FF";
|
|
56
|
+
readonly abstain_secondary: "#E7E5E4";
|
|
57
|
+
readonly default: "#57534e";
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { ProposalErrorCodes, ProposalState, ProposalTypeEnum, VoteColorMap, VoteEnum };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps the proposal state from the governor contract to a more human-readable format.
|
|
3
|
+
* Don't edit this enum manually, it's synced with the governor contract.
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/IGovernor.sol
|
|
6
|
+
*/
|
|
7
|
+
declare enum ProposalState {
|
|
8
|
+
Pending = 0,
|
|
9
|
+
Active = 1,
|
|
10
|
+
Canceled = 2,
|
|
11
|
+
Defeated = 3,
|
|
12
|
+
Succeeded = 4,
|
|
13
|
+
Queued = 5,
|
|
14
|
+
Expired = 6,
|
|
15
|
+
Executed = 7
|
|
16
|
+
}
|
|
17
|
+
declare enum VoteEnum {
|
|
18
|
+
AGAINST = "no",
|
|
19
|
+
FOR = "yes",
|
|
20
|
+
ABSTAIN = "abstain"
|
|
21
|
+
}
|
|
22
|
+
declare enum ProposalErrorCodes {
|
|
23
|
+
REQUIRED = "Required",
|
|
24
|
+
INVALID_AMOUNT = "Invalid amount",
|
|
25
|
+
NEGATIVE_AMOUNT = "Negative amount",
|
|
26
|
+
INVALID_ADDRESS = "Invalid address",
|
|
27
|
+
INVALID_ACTION = "Invalid action",
|
|
28
|
+
INVALID_ABI = "Invalid ABI",
|
|
29
|
+
MUST_BE_HTTPS = "Must be HTTPS",
|
|
30
|
+
MUST_BE_HTTPS_OR_IPFS = "Must be HTTPS or IPFS",
|
|
31
|
+
INVALID_BASEPATH = "Must be a berachain forum link",
|
|
32
|
+
/**
|
|
33
|
+
* Mainly used when it's not a reward vault
|
|
34
|
+
*/
|
|
35
|
+
INVALID_CONTRACT = "This is not a valid contract"
|
|
36
|
+
}
|
|
37
|
+
declare enum ProposalTypeEnum {
|
|
38
|
+
CUSTOM_PROPOSAL = "custom-action",
|
|
39
|
+
WHITELIST_REWARD_VAULT = "whitelist-reward-vault",
|
|
40
|
+
BLACKLIST_REWARD_VAULT = "blacklist-reward-vault",
|
|
41
|
+
ERC20_TRANSFER = "erc20-transfer",
|
|
42
|
+
WHITELIST_REWARD_VAULT_INCENTIVE = "whitelist-reward-vault-incentive"
|
|
43
|
+
}
|
|
44
|
+
declare const VoteColorMap: {
|
|
45
|
+
readonly yes: "#059669";
|
|
46
|
+
readonly 1: "#059669";
|
|
47
|
+
readonly no: "#DC2629";
|
|
48
|
+
readonly 2: "#DC2629";
|
|
49
|
+
readonly veto: "#0284C7";
|
|
50
|
+
readonly 4: "#0284C7";
|
|
51
|
+
readonly abstain: "#78716c";
|
|
52
|
+
readonly 3: "#78716c";
|
|
53
|
+
readonly yes_secondary: "#ECFDF5";
|
|
54
|
+
readonly no_secondary: "#FEF2F2";
|
|
55
|
+
readonly veto_secondary: "#F0F9FF";
|
|
56
|
+
readonly abstain_secondary: "#E7E5E4";
|
|
57
|
+
readonly default: "#57534e";
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { ProposalErrorCodes, ProposalState, ProposalTypeEnum, VoteColorMap, VoteEnum };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/errors/exports.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkREWME3FYcjs = require('../chunk-REWME3FY.cjs');var _chunkY2FETC6Tcjs = require('../chunk-Y2FETC6T.cjs');var _chunk33XNWMPPcjs = require('../chunk-33XNWMPP.cjs');var _chunkS4CDSVLKcjs = require('../chunk-S4CDSVLK.cjs');var _chunk6JJIZCVYcjs = require('../chunk-6JJIZCVY.cjs');exports.BeraError = _chunk6JJIZCVYcjs.f; exports.BeraMonitoring = _chunkY2FETC6Tcjs.b; exports.BeraTracing = _chunkS4CDSVLKcjs.a; exports.InvalidArgumentError = _chunk6JJIZCVYcjs.h; exports.NotFoundError = _chunkREWME3FYcjs.a; exports.RequestError = _chunk6JJIZCVYcjs.g; exports.TransactionFailedError = _chunkREWME3FYcjs.b; exports.assertAddress = _chunk33XNWMPPcjs.c; exports.assertAmount = _chunk33XNWMPPcjs.e; exports.assertDefined = _chunk33XNWMPPcjs.a; exports.assertPositive = _chunk33XNWMPPcjs.d; exports.assertPublicClient = _chunk33XNWMPPcjs.b; exports.findMatchingError = _chunk6JJIZCVYcjs.a; exports.getErrorMessage = _chunk6JJIZCVYcjs.b; exports.initBeraError = _chunkY2FETC6Tcjs.a;
|
|
2
2
|
//# sourceMappingURL=exports.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/liammcaweeney/Work/bera/monobera/packages/berajs/dist/errors/exports.cjs"],"names":[],"mappings":"AAAA,kIAAgD,yDAAiD,yDAAsE,yDAA0C,yDAAsE,urBAA0T","file":"/Users/liammcaweeney/Work/bera/monobera/packages/berajs/dist/errors/exports.cjs"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { GetPublicClientReturnType } from '@wagmi/core';
|
|
2
2
|
import { Address, PublicClient, TransactionReceipt } from 'viem';
|
|
3
3
|
import { B as BeraError, S as SeverityLevel, I as IBeraErrorArgs } from '../BeraError-_mQdkanr.cjs';
|
|
4
|
-
|
|
4
|
+
import { E as EmitterMixin } from '../RequestError-DSUzJ1Iy.cjs';
|
|
5
|
+
export { B as BeraTracing, R as RequestError, S as SpanContext } from '../RequestError-DSUzJ1Iy.cjs';
|
|
5
6
|
import { Hex } from '@berachain-foundation/berancer-sdk';
|
|
6
7
|
import '@apollo/client';
|
|
7
8
|
|
|
@@ -64,37 +65,6 @@ value: unknown,
|
|
|
64
65
|
*/
|
|
65
66
|
property: string): asserts value is string | number;
|
|
66
67
|
|
|
67
|
-
interface EventsMap {
|
|
68
|
-
[event: string]: any;
|
|
69
|
-
}
|
|
70
|
-
interface DefaultEvents extends EventsMap {
|
|
71
|
-
[event: string]: (...args: any) => void;
|
|
72
|
-
}
|
|
73
|
-
type Unsubscribe = () => void;
|
|
74
|
-
/**
|
|
75
|
-
* An interface for mixins that expose the `on` function (without the emitter
|
|
76
|
-
* bound to `this`)
|
|
77
|
-
*
|
|
78
|
-
* ```js
|
|
79
|
-
* import { createEmitter } from '~utils/createEmitter'
|
|
80
|
-
*
|
|
81
|
-
* class Ticker implements EmitterMixin<Events> {
|
|
82
|
-
* constructor() {
|
|
83
|
-
* this.emitter = createEmitter()
|
|
84
|
-
* }
|
|
85
|
-
* on(...args) {
|
|
86
|
-
* return this.emitter.on(...args)
|
|
87
|
-
* }
|
|
88
|
-
* tick() {
|
|
89
|
-
* this.emitter.emit('tick')
|
|
90
|
-
* }
|
|
91
|
-
* }
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
interface EmitterMixin<Events extends EventsMap = DefaultEvents> {
|
|
95
|
-
on<K extends keyof Events>(event: K, cb: Events[K]): Unsubscribe;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
68
|
/**
|
|
99
69
|
* Context passed alongside captured exceptions.
|
|
100
70
|
* Mirrors the subset of Sentry's CaptureContext that berajs actually uses.
|
|
@@ -138,62 +108,6 @@ declare const BeraMonitoring: {
|
|
|
138
108
|
exception: (event: ErrorEvent) => void;
|
|
139
109
|
}>;
|
|
140
110
|
|
|
141
|
-
/**
|
|
142
|
-
* Span context passed to tracing handlers.
|
|
143
|
-
* Compatible with Sentry's StartSpanOptions (name, op, attributes).
|
|
144
|
-
*/
|
|
145
|
-
type SpanContext = {
|
|
146
|
-
name: string;
|
|
147
|
-
op: string;
|
|
148
|
-
attributes: Record<string, string | number | boolean | undefined>;
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* A function that wraps a callback in a tracing span.
|
|
152
|
-
* Compatible with Sentry.startSpan's signature.
|
|
153
|
-
*/
|
|
154
|
-
type StartSpanFn = <T>(context: SpanContext, callback: () => Promise<T>) => Promise<T>;
|
|
155
|
-
/**
|
|
156
|
-
* A generic span-tracing module for berajs.
|
|
157
|
-
*
|
|
158
|
-
* Instead of calling Sentry.startSpan directly, berajs calls
|
|
159
|
-
* `BeraTracing.startSpan()`. Consumer apps subscribe via `.on("span", handler)`
|
|
160
|
-
* and forward spans to their tracing provider (Sentry, Datadog, etc.).
|
|
161
|
-
*
|
|
162
|
-
* Multiple handlers are supported and chain in registration order:
|
|
163
|
-
* the first registered handler is the outermost wrapper.
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* ```ts
|
|
167
|
-
* // In berajs code:
|
|
168
|
-
* import { BeraTracing } from "./BeraTracing";
|
|
169
|
-
* const result = await BeraTracing.startSpan(
|
|
170
|
-
* { name: "GraphQL query", op: "graphql.query", attributes: {} },
|
|
171
|
-
* () => executeQuery(),
|
|
172
|
-
* );
|
|
173
|
-
*
|
|
174
|
-
* // In app instrumentation:
|
|
175
|
-
* import { BeraTracing } from "@berachain/berajs/errors";
|
|
176
|
-
* BeraTracing.addSpanHandler(Sentry.startSpan);
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
declare const BeraTracing: {
|
|
180
|
-
/**
|
|
181
|
-
* Execute a callback, wrapping it in all registered span handlers.
|
|
182
|
-
*
|
|
183
|
-
* Handlers chain so each wraps the next. First registered = outermost wrapper.
|
|
184
|
-
* If no handlers are registered, the callback is executed directly.
|
|
185
|
-
*/
|
|
186
|
-
startSpan<T>(context: SpanContext, callback: () => Promise<T>): Promise<T>;
|
|
187
|
-
/**
|
|
188
|
-
* Register a span tracing handler.
|
|
189
|
-
*
|
|
190
|
-
* @param _event - Must be "span". Exists for API consistency with BeraMonitoring.
|
|
191
|
-
* @param handler - A StartSpanFn, e.g. Sentry.startSpan.
|
|
192
|
-
* @returns An unsubscribe function to remove the handler.
|
|
193
|
-
*/
|
|
194
|
-
addSpanHandler(handler: StartSpanFn): Unsubscribe;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
111
|
interface MatchedError {
|
|
198
112
|
/** The error key in the errorMap (e.g. "NOT_ENOUGH_GAS_TOKEN") */
|
|
199
113
|
key: string;
|
|
@@ -410,4 +324,4 @@ declare class TransactionFailedError extends BeraError {
|
|
|
410
324
|
});
|
|
411
325
|
}
|
|
412
326
|
|
|
413
|
-
export { BeraError, BeraMonitoring,
|
|
327
|
+
export { BeraError, BeraMonitoring, type CaptureContext, type ErrorEvent, IBeraErrorArgs, type IInvalidArgumentErrorArgs, type INotFoundErrorArgs, InvalidArgumentError, type MatchedError, NotFoundError, SeverityLevel, TransactionFailedError, assertAddress, assertAmount, assertDefined, assertPositive, assertPublicClient, findMatchingError, getErrorMessage, initBeraError };
|
package/dist/errors/exports.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { GetPublicClientReturnType } from '@wagmi/core';
|
|
2
2
|
import { Address, PublicClient, TransactionReceipt } from 'viem';
|
|
3
3
|
import { B as BeraError, S as SeverityLevel, I as IBeraErrorArgs } from '../BeraError-_mQdkanr.js';
|
|
4
|
-
|
|
4
|
+
import { E as EmitterMixin } from '../RequestError-BRIiJgHk.js';
|
|
5
|
+
export { B as BeraTracing, R as RequestError, S as SpanContext } from '../RequestError-BRIiJgHk.js';
|
|
5
6
|
import { Hex } from '@berachain-foundation/berancer-sdk';
|
|
6
7
|
import '@apollo/client';
|
|
7
8
|
|
|
@@ -64,37 +65,6 @@ value: unknown,
|
|
|
64
65
|
*/
|
|
65
66
|
property: string): asserts value is string | number;
|
|
66
67
|
|
|
67
|
-
interface EventsMap {
|
|
68
|
-
[event: string]: any;
|
|
69
|
-
}
|
|
70
|
-
interface DefaultEvents extends EventsMap {
|
|
71
|
-
[event: string]: (...args: any) => void;
|
|
72
|
-
}
|
|
73
|
-
type Unsubscribe = () => void;
|
|
74
|
-
/**
|
|
75
|
-
* An interface for mixins that expose the `on` function (without the emitter
|
|
76
|
-
* bound to `this`)
|
|
77
|
-
*
|
|
78
|
-
* ```js
|
|
79
|
-
* import { createEmitter } from '~utils/createEmitter'
|
|
80
|
-
*
|
|
81
|
-
* class Ticker implements EmitterMixin<Events> {
|
|
82
|
-
* constructor() {
|
|
83
|
-
* this.emitter = createEmitter()
|
|
84
|
-
* }
|
|
85
|
-
* on(...args) {
|
|
86
|
-
* return this.emitter.on(...args)
|
|
87
|
-
* }
|
|
88
|
-
* tick() {
|
|
89
|
-
* this.emitter.emit('tick')
|
|
90
|
-
* }
|
|
91
|
-
* }
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
interface EmitterMixin<Events extends EventsMap = DefaultEvents> {
|
|
95
|
-
on<K extends keyof Events>(event: K, cb: Events[K]): Unsubscribe;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
68
|
/**
|
|
99
69
|
* Context passed alongside captured exceptions.
|
|
100
70
|
* Mirrors the subset of Sentry's CaptureContext that berajs actually uses.
|
|
@@ -138,62 +108,6 @@ declare const BeraMonitoring: {
|
|
|
138
108
|
exception: (event: ErrorEvent) => void;
|
|
139
109
|
}>;
|
|
140
110
|
|
|
141
|
-
/**
|
|
142
|
-
* Span context passed to tracing handlers.
|
|
143
|
-
* Compatible with Sentry's StartSpanOptions (name, op, attributes).
|
|
144
|
-
*/
|
|
145
|
-
type SpanContext = {
|
|
146
|
-
name: string;
|
|
147
|
-
op: string;
|
|
148
|
-
attributes: Record<string, string | number | boolean | undefined>;
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* A function that wraps a callback in a tracing span.
|
|
152
|
-
* Compatible with Sentry.startSpan's signature.
|
|
153
|
-
*/
|
|
154
|
-
type StartSpanFn = <T>(context: SpanContext, callback: () => Promise<T>) => Promise<T>;
|
|
155
|
-
/**
|
|
156
|
-
* A generic span-tracing module for berajs.
|
|
157
|
-
*
|
|
158
|
-
* Instead of calling Sentry.startSpan directly, berajs calls
|
|
159
|
-
* `BeraTracing.startSpan()`. Consumer apps subscribe via `.on("span", handler)`
|
|
160
|
-
* and forward spans to their tracing provider (Sentry, Datadog, etc.).
|
|
161
|
-
*
|
|
162
|
-
* Multiple handlers are supported and chain in registration order:
|
|
163
|
-
* the first registered handler is the outermost wrapper.
|
|
164
|
-
*
|
|
165
|
-
* @example
|
|
166
|
-
* ```ts
|
|
167
|
-
* // In berajs code:
|
|
168
|
-
* import { BeraTracing } from "./BeraTracing";
|
|
169
|
-
* const result = await BeraTracing.startSpan(
|
|
170
|
-
* { name: "GraphQL query", op: "graphql.query", attributes: {} },
|
|
171
|
-
* () => executeQuery(),
|
|
172
|
-
* );
|
|
173
|
-
*
|
|
174
|
-
* // In app instrumentation:
|
|
175
|
-
* import { BeraTracing } from "@berachain/berajs/errors";
|
|
176
|
-
* BeraTracing.addSpanHandler(Sentry.startSpan);
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
declare const BeraTracing: {
|
|
180
|
-
/**
|
|
181
|
-
* Execute a callback, wrapping it in all registered span handlers.
|
|
182
|
-
*
|
|
183
|
-
* Handlers chain so each wraps the next. First registered = outermost wrapper.
|
|
184
|
-
* If no handlers are registered, the callback is executed directly.
|
|
185
|
-
*/
|
|
186
|
-
startSpan<T>(context: SpanContext, callback: () => Promise<T>): Promise<T>;
|
|
187
|
-
/**
|
|
188
|
-
* Register a span tracing handler.
|
|
189
|
-
*
|
|
190
|
-
* @param _event - Must be "span". Exists for API consistency with BeraMonitoring.
|
|
191
|
-
* @param handler - A StartSpanFn, e.g. Sentry.startSpan.
|
|
192
|
-
* @returns An unsubscribe function to remove the handler.
|
|
193
|
-
*/
|
|
194
|
-
addSpanHandler(handler: StartSpanFn): Unsubscribe;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
111
|
interface MatchedError {
|
|
198
112
|
/** The error key in the errorMap (e.g. "NOT_ENOUGH_GAS_TOKEN") */
|
|
199
113
|
key: string;
|
|
@@ -410,4 +324,4 @@ declare class TransactionFailedError extends BeraError {
|
|
|
410
324
|
});
|
|
411
325
|
}
|
|
412
326
|
|
|
413
|
-
export { BeraError, BeraMonitoring,
|
|
327
|
+
export { BeraError, BeraMonitoring, type CaptureContext, type ErrorEvent, IBeraErrorArgs, type IInvalidArgumentErrorArgs, type INotFoundErrorArgs, InvalidArgumentError, type MatchedError, NotFoundError, SeverityLevel, TransactionFailedError, assertAddress, assertAmount, assertDefined, assertPositive, assertPublicClient, findMatchingError, getErrorMessage, initBeraError };
|
package/dist/errors/exports.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as C,b as g}from"../chunk-RJN36GBU.mjs";import{a as m,b as e}from"../chunk-ZW2N63FI.mjs";import{a as n,b as y,c as a,d as i,e as v}from"../chunk-5QAFKFM5.mjs";import{a as r}from"../chunk-PRLVZIKD.mjs";import{a as o,b as t,f as p,g as x,h as f}from"../chunk-GXV2JA36.mjs";export{p as BeraError,e as BeraMonitoring,r as BeraTracing,f as InvalidArgumentError,C as NotFoundError,x as RequestError,g as TransactionFailedError,a as assertAddress,v as assertAmount,n as assertDefined,i as assertPositive,y as assertPublicClient,o as findMatchingError,t as getErrorMessage,m as initBeraError};
|
|
2
2
|
//# sourceMappingURL=exports.mjs.map
|
|
@@ -3,7 +3,7 @@ import { BeraConfig, ChainId } from '@berachain/config/internal';
|
|
|
3
3
|
import { I as IAggregatorArgs, g as IRawAggregatorQuote, b as Token, d as HoneyConfigContextReturn, B as BalanceToken, P as PythLatestUpdates } from './HoneyConfigProvider-DfkjmzEf.cjs';
|
|
4
4
|
import { A as Aggregators } from './dex-C_BB0b0O.cjs';
|
|
5
5
|
import { GqlPoolType, GlobalDataQuery, ApiVaultFragment, GetVaultsQueryVariables, GqlChain, GetVaultHistoryQueryVariables, GetVaultHistoryQuery, ApiValidatorInListFragment } from '@berachain/graphql/pol/api';
|
|
6
|
-
import { P as ProtocolMetadata } from './
|
|
6
|
+
import { P as ProtocolMetadata } from './pol.d-o6Iw75bK.cjs';
|
|
7
7
|
|
|
8
8
|
interface GetConvertToAssetsProps {
|
|
9
9
|
sharesAmount: bigint;
|
|
@@ -131,7 +131,7 @@ interface OnChainPool {
|
|
|
131
131
|
swapFee: string;
|
|
132
132
|
decimals: number;
|
|
133
133
|
weights: readonly string[] | undefined;
|
|
134
|
-
version:
|
|
134
|
+
version: unknown;
|
|
135
135
|
factory: Address;
|
|
136
136
|
type: GqlPoolType;
|
|
137
137
|
/**
|
|
@@ -3,7 +3,7 @@ import { BeraConfig, ChainId } from '@berachain/config/internal';
|
|
|
3
3
|
import { I as IAggregatorArgs, g as IRawAggregatorQuote, b as Token, d as HoneyConfigContextReturn, B as BalanceToken, P as PythLatestUpdates } from './HoneyConfigProvider-DVP_9KZn.js';
|
|
4
4
|
import { A as Aggregators } from './dex-C_BB0b0O.js';
|
|
5
5
|
import { GqlPoolType, GlobalDataQuery, ApiVaultFragment, GetVaultsQueryVariables, GqlChain, GetVaultHistoryQueryVariables, GetVaultHistoryQuery, ApiValidatorInListFragment } from '@berachain/graphql/pol/api';
|
|
6
|
-
import { P as ProtocolMetadata } from './
|
|
6
|
+
import { P as ProtocolMetadata } from './pol.d-qR8bGEP5.js';
|
|
7
7
|
|
|
8
8
|
interface GetConvertToAssetsProps {
|
|
9
9
|
sharesAmount: bigint;
|
|
@@ -131,7 +131,7 @@ interface OnChainPool {
|
|
|
131
131
|
swapFee: string;
|
|
132
132
|
decimals: number;
|
|
133
133
|
weights: readonly string[] | undefined;
|
|
134
|
-
version:
|
|
134
|
+
version: unknown;
|
|
135
135
|
factory: Address;
|
|
136
136
|
type: GqlPoolType;
|
|
137
137
|
/**
|