@berachain/berajs 0.2.8-beta.9 → 0.2.9
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/{BeraError-_mQdkanr.d.cts → BeraError-7-A5JYy_.d.ts} +31 -2
- package/dist/{HoneyConfigProvider-DVP_9KZn.d.ts → HoneyConfigProvider-Dkj-_a5x.d.ts} +1 -1
- package/dist/{RequestError-BRIiJgHk.d.ts → RequestError-DBOIV65x.d.ts} +1 -1
- package/dist/abi/exports.mjs +4452 -2
- package/dist/actions/clients/exports.d.ts +2 -0
- package/dist/actions/clients/exports.mjs +12 -0
- package/dist/actions/exports.d.ts +104 -189
- package/dist/actions/exports.mjs +853 -2
- package/dist/actions/governance/exports.d.ts +140 -0
- package/dist/actions/governance/exports.mjs +226 -0
- package/dist/actions/server/exports.d.ts +13 -0
- package/dist/actions/server/exports.mjs +27 -0
- package/dist/chunk-3EARVV7K.mjs +414 -0
- package/dist/chunk-4Z4AK6SH.mjs +211 -0
- package/dist/chunk-75M6TF7M.mjs +25 -0
- package/dist/chunk-AFN4CVD3.mjs +326 -0
- package/dist/chunk-BGMRHTBQ.mjs +23 -0
- package/dist/chunk-CDFWPU2R.mjs +473 -0
- package/dist/chunk-CDK4YV3D.mjs +571 -0
- package/dist/chunk-DKMAIU74.mjs +62 -0
- package/dist/chunk-EXIUPSFN.mjs +86 -0
- package/dist/chunk-FFB5LFDW.mjs +35 -0
- package/dist/chunk-HQCOU6GY.mjs +243 -0
- package/dist/chunk-HSSJKHZ4.mjs +135 -0
- package/dist/chunk-J5I45WGQ.mjs +1769 -0
- package/dist/chunk-KQUMKB66.mjs +89 -0
- package/dist/chunk-NBYLMO2L.mjs +14 -0
- package/dist/chunk-NPBQLVL3.mjs +80 -0
- package/dist/chunk-O2NQFKJK.mjs +170 -0
- package/dist/chunk-QJIXTYTZ.mjs +4054 -0
- package/dist/chunk-SGIJVHZO.mjs +12 -0
- package/dist/chunk-SZ5C44L5.mjs +35 -0
- package/dist/chunk-WXXOISTU.mjs +96 -0
- package/dist/chunk-XIYN6AL6.mjs +160 -0
- package/dist/contexts/exports.d.ts +2 -2
- package/dist/contexts/exports.mjs +85 -2
- package/dist/enum/exports.d.ts +1 -1
- package/dist/enum/exports.mjs +46 -2
- package/dist/enum/governance/exports.d.ts +60 -0
- package/dist/enum/governance/exports.mjs +14 -0
- package/dist/errors/exports.d.ts +4 -3
- package/dist/errors/exports.mjs +48 -2
- package/dist/exports-BcUTGFUb.d.ts +40 -0
- package/dist/{getValidatorQueuedOperatorAddress-BcyxE9uw.d.ts → getValidatorQueuedOperatorAddress-Dw5KN5sh.d.ts} +2 -2
- package/dist/{global.d-5w_lvl2J.d.ts → global.d-BuGDKh4k.d.ts} +4 -240
- package/dist/hooks/exports.d.ts +69 -211
- package/dist/hooks/exports.mjs +7434 -4
- package/dist/hooks/governance/exports.d.ts +181 -0
- package/dist/hooks/governance/exports.mjs +888 -0
- package/dist/pol.d-CqPA9K6m.d.ts +142 -0
- package/dist/{txnEnum-7_o92X3N.d.cts → txnEnum-ByI5dtDi.d.ts} +2 -60
- package/dist/types/exports.d.ts +9 -9
- package/dist/types/exports.mjs +0 -1
- package/dist/types/governance/exports.d.ts +109 -0
- package/dist/types/governance/exports.mjs +0 -0
- package/dist/{useHoneySwapState-B494PQDl.d.ts → useHoneySwapState-vFmuFF0g.d.ts} +1 -1
- package/dist/utils/exports.d.ts +15 -6
- package/dist/utils/exports.mjs +825 -2
- package/package.json +49 -13
- package/src/actions/__test/transports.ts +61 -0
- package/src/actions/clients/exports.ts +4 -0
- package/src/actions/clients/getApolloClient.ts +58 -23
- package/src/actions/clients/getEnsoClient.ts +20 -9
- package/src/actions/dex/aggregators/enso/enso.ts +27 -17
- package/src/actions/dex/aggregators/enso/ensoErc4626.ts +2 -2
- package/src/actions/dex/aggregators/kyberswap.ts +18 -23
- package/src/actions/enso/__tests__/getEnsoUserTokensWithBalances.debug.test.ts +3 -6
- package/src/actions/exports.ts +4 -9
- package/src/actions/governance/exports.ts +9 -0
- package/src/actions/governance/getAllProposals.ts +10 -65
- package/src/actions/governance/getProposalDetails.ts +6 -33
- package/src/actions/governance/getProposalVotes.ts +8 -15
- package/src/actions/honey/getChartData.ts +27 -21
- package/src/actions/honey/getHoney24hVolume.ts +19 -22
- package/src/actions/pol/getAutoclaimedIncentives.ts +30 -0
- package/src/actions/pol/getBeraTokenTotalSupply.ts +45 -0
- package/src/actions/pol/getBgtIncentiveDistributorPaused.ts +35 -0
- package/src/actions/pol/getEarnedStakedBeraVault.ts +7 -11
- package/src/actions/pol/getGlobalData.ts +1 -0
- package/src/actions/pol/getHeroEarnVaults.ts +62 -0
- package/src/actions/pol/getIncentiveFeeClaimStats.ts +19 -38
- package/src/actions/pol/getSWBeraVaultMetadata.ts +1 -1
- package/src/actions/pol/getStakingDailyAssets.ts +7 -10
- package/src/actions/server/exports.ts +1 -0
- package/src/actions/server/getDailyValidatorBlockStats.ts +33 -0
- package/src/actions/tokens/getWalletBalances.integration.test.ts +3 -6
- package/src/actions/transactions/beraWriteContract.integration.test.ts +3 -6
- package/src/actions/validators/getDailyValidatorBlockStats.ts +25 -24
- package/src/actions/validators/getValidatorAnalytics.ts +20 -21
- package/src/actions/validators/getValidatorIncentiveDistribution.ts +33 -0
- package/src/enum/contracts.ts +1 -0
- package/src/enum/exports.ts +0 -1
- package/src/enum/governance/exports.ts +1 -0
- package/src/errors/BeraError.ts +47 -7
- package/src/errors/BeraTracing.unit.test.ts +65 -0
- package/src/errors/RequestError.ts +13 -1
- package/src/errors/exports.ts +5 -0
- package/src/errors/getRevertReason.integration.test.ts +3 -3
- package/src/errors/spanStatus.ts +78 -0
- package/src/errors/spanStatus.unit.test.ts +62 -0
- package/src/hooks/dex/useCreatePool.ts +1 -88
- package/src/hooks/dex/useOnChainPoolData.ts +27 -2
- package/src/hooks/dex/usePriceImpact.ts +12 -5
- package/src/hooks/enso/useBendDemultiply.ts +9 -1
- package/src/hooks/enso/useBendMultiply.ts +9 -1
- package/src/hooks/enso/useBendZapSupply.ts +26 -7
- package/src/hooks/enso/useEnsoSwapBundle.ts +17 -3
- package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +13 -2
- package/src/hooks/exports.ts +2 -15
- package/src/hooks/governance/exports.ts +14 -0
- package/src/hooks/pol/useAutoclaimedIncentives.ts +49 -0
- package/src/hooks/pol/useStakedAPR.ts +2 -2
- package/src/hooks/pol/useStakedSnapshots.ts +5 -9
- package/src/hooks/validators/useValidator.ts +2 -0
- package/src/hooks/validators/useValidatorIncentiveDistribution.ts +39 -0
- package/src/types/bribe-boost.d.ts +8 -0
- package/src/types/exports.ts +0 -1
- package/src/types/governance/exports.ts +1 -0
- package/src/utils/beraFetch.ts +9 -3
- package/src/utils/exports.ts +1 -0
- package/src/utils/getServerSideClient.ts +4 -2
- package/src/utils/sanitizeRpcUrl.ts +22 -0
- package/src/utils/tracedTransport.ts +35 -0
- package/dist/BeraError-_mQdkanr.d.ts +0 -94
- package/dist/BexStatusProvider-DRymVlQf.d.cts +0 -70
- package/dist/HoneyConfigProvider-DfkjmzEf.d.cts +0 -390
- package/dist/RequestError-DSUzJ1Iy.d.cts +0 -144
- package/dist/abi/exports.cjs +0 -2
- package/dist/abi/exports.cjs.map +0 -1
- package/dist/abi/exports.d.cts +0 -6574
- package/dist/abi/exports.mjs.map +0 -1
- package/dist/actions/exports.cjs +0 -2
- package/dist/actions/exports.cjs.map +0 -1
- package/dist/actions/exports.d.cts +0 -1650
- package/dist/actions/exports.mjs.map +0 -1
- package/dist/chunk-45HIEVNI.cjs +0 -4
- package/dist/chunk-45HIEVNI.cjs.map +0 -1
- package/dist/chunk-47ILYVHC.mjs +0 -2
- package/dist/chunk-47ILYVHC.mjs.map +0 -1
- package/dist/chunk-575OK77P.mjs +0 -2
- package/dist/chunk-575OK77P.mjs.map +0 -1
- package/dist/chunk-5NVZG5N6.mjs +0 -2
- package/dist/chunk-5NVZG5N6.mjs.map +0 -1
- package/dist/chunk-6DIA6PXV.cjs +0 -2
- package/dist/chunk-6DIA6PXV.cjs.map +0 -1
- package/dist/chunk-6JJIZCVY.cjs +0 -2
- package/dist/chunk-6JJIZCVY.cjs.map +0 -1
- package/dist/chunk-7F72ZH4Q.mjs +0 -2
- package/dist/chunk-7F72ZH4Q.mjs.map +0 -1
- package/dist/chunk-AUA42YIG.mjs +0 -4
- package/dist/chunk-AUA42YIG.mjs.map +0 -1
- package/dist/chunk-BC2WX6O6.cjs +0 -2
- package/dist/chunk-BC2WX6O6.cjs.map +0 -1
- package/dist/chunk-CJOZC5Z2.cjs +0 -2
- package/dist/chunk-CJOZC5Z2.cjs.map +0 -1
- package/dist/chunk-D6L7LTA2.cjs +0 -2
- package/dist/chunk-D6L7LTA2.cjs.map +0 -1
- package/dist/chunk-DDEQFR3M.cjs +0 -2
- package/dist/chunk-DDEQFR3M.cjs.map +0 -1
- package/dist/chunk-GXV2JA36.mjs +0 -2
- package/dist/chunk-GXV2JA36.mjs.map +0 -1
- package/dist/chunk-ISYNEDET.mjs +0 -2
- package/dist/chunk-ISYNEDET.mjs.map +0 -1
- package/dist/chunk-JDDRTHFG.mjs +0 -2
- package/dist/chunk-JDDRTHFG.mjs.map +0 -1
- package/dist/chunk-JDZGYU5T.mjs +0 -2
- package/dist/chunk-JDZGYU5T.mjs.map +0 -1
- package/dist/chunk-LVOXBZMA.cjs +0 -2
- package/dist/chunk-LVOXBZMA.cjs.map +0 -1
- package/dist/chunk-MK5NS5B5.mjs +0 -2
- package/dist/chunk-MK5NS5B5.mjs.map +0 -1
- package/dist/chunk-NAXAZJJY.mjs +0 -2
- package/dist/chunk-NAXAZJJY.mjs.map +0 -1
- package/dist/chunk-NLVWRMGD.mjs +0 -2
- package/dist/chunk-NLVWRMGD.mjs.map +0 -1
- package/dist/chunk-OGBD5YOG.mjs +0 -2
- package/dist/chunk-OGBD5YOG.mjs.map +0 -1
- package/dist/chunk-OGJMSGB2.mjs +0 -2
- package/dist/chunk-OGJMSGB2.mjs.map +0 -1
- package/dist/chunk-OIYXOKTT.cjs +0 -2
- package/dist/chunk-OIYXOKTT.cjs.map +0 -1
- package/dist/chunk-OUD27MU7.cjs +0 -2
- package/dist/chunk-OUD27MU7.cjs.map +0 -1
- package/dist/chunk-PRLVZIKD.mjs +0 -2
- package/dist/chunk-PRLVZIKD.mjs.map +0 -1
- package/dist/chunk-Q2SNRLW3.cjs +0 -2
- package/dist/chunk-Q2SNRLW3.cjs.map +0 -1
- package/dist/chunk-REWME3FY.cjs +0 -2
- package/dist/chunk-REWME3FY.cjs.map +0 -1
- package/dist/chunk-RJN36GBU.mjs +0 -2
- package/dist/chunk-RJN36GBU.mjs.map +0 -1
- package/dist/chunk-RWOICHRW.cjs +0 -2
- package/dist/chunk-RWOICHRW.cjs.map +0 -1
- package/dist/chunk-S4CDSVLK.cjs +0 -2
- package/dist/chunk-S4CDSVLK.cjs.map +0 -1
- package/dist/chunk-SFEULGSX.cjs +0 -2
- package/dist/chunk-SFEULGSX.cjs.map +0 -1
- package/dist/chunk-WBTS6KFG.mjs +0 -2
- package/dist/chunk-WBTS6KFG.mjs.map +0 -1
- package/dist/chunk-WRFDB3QJ.cjs +0 -2
- package/dist/chunk-WRFDB3QJ.cjs.map +0 -1
- package/dist/chunk-XNJLSA6P.cjs +0 -2
- package/dist/chunk-XNJLSA6P.cjs.map +0 -1
- package/dist/contexts/exports.cjs +0 -2
- package/dist/contexts/exports.cjs.map +0 -1
- package/dist/contexts/exports.d.cts +0 -66
- package/dist/contexts/exports.mjs.map +0 -1
- package/dist/defaultFlags-D6KfkTZx.d.cts +0 -10
- package/dist/dex-C_BB0b0O.d.cts +0 -37
- package/dist/enum/exports.cjs +0 -2
- package/dist/enum/exports.cjs.map +0 -1
- package/dist/enum/exports.d.cts +0 -23
- package/dist/enum/exports.mjs.map +0 -1
- package/dist/errors/exports.cjs +0 -2
- package/dist/errors/exports.cjs.map +0 -1
- package/dist/errors/exports.d.cts +0 -327
- package/dist/errors/exports.mjs.map +0 -1
- package/dist/getValidatorQueuedOperatorAddress-Cql_D50j.d.cts +0 -562
- package/dist/global.d-B7IeayVX.d.cts +0 -474
- package/dist/honey-CYm0RWf4.d.cts +0 -14
- package/dist/hooks/exports.cjs +0 -4
- package/dist/hooks/exports.cjs.map +0 -1
- package/dist/hooks/exports.d.cts +0 -1734
- package/dist/hooks/exports.mjs.map +0 -1
- package/dist/polling-BKnyavLI.d.cts +0 -8
- package/dist/txnEnum-7_o92X3N.d.ts +0 -164
- package/dist/types/exports.cjs +0 -1
- package/dist/types/exports.cjs.map +0 -1
- package/dist/types/exports.d.cts +0 -90
- package/dist/types/exports.mjs.map +0 -1
- package/dist/useHoneySwapState-D6vpv19r.d.cts +0 -32
- package/dist/utils/exports.cjs +0 -2
- package/dist/utils/exports.cjs.map +0 -1
- package/dist/utils/exports.d.cts +0 -420
- package/dist/utils/exports.mjs.map +0 -1
- package/src/actions/dex/getIsTokenExploited.ts +0 -63
- package/src/hooks/dex/useExploitedTokens.ts +0 -57
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/enum/polling.ts
|
|
2
|
+
var POLLING = /* @__PURE__ */ ((POLLING2) => {
|
|
3
|
+
POLLING2[POLLING2["FAST"] = 1e4] = "FAST";
|
|
4
|
+
POLLING2[POLLING2["NORMAL"] = 1e5] = "NORMAL";
|
|
5
|
+
POLLING2[POLLING2["SLOW"] = 18e4] = "SLOW";
|
|
6
|
+
POLLING2[POLLING2["REFRESH_BLOCK_INTERVAL"] = 1e4] = "REFRESH_BLOCK_INTERVAL";
|
|
7
|
+
return POLLING2;
|
|
8
|
+
})(POLLING || {});
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
POLLING
|
|
12
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/errors/BeraTracing.ts
|
|
2
|
+
var _handlers = [];
|
|
3
|
+
var BeraTracing = {
|
|
4
|
+
/**
|
|
5
|
+
* Execute a callback, wrapping it in all registered span handlers.
|
|
6
|
+
*
|
|
7
|
+
* Handlers chain so each wraps the next. First registered = outermost wrapper.
|
|
8
|
+
* If no handlers are registered, the callback is executed directly.
|
|
9
|
+
*/
|
|
10
|
+
startSpan(context, callback) {
|
|
11
|
+
if (_handlers.length === 0) return callback();
|
|
12
|
+
return _handlers.reduceRight(
|
|
13
|
+
(next, handler) => () => handler(context, next),
|
|
14
|
+
callback
|
|
15
|
+
)();
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Register a span tracing handler.
|
|
19
|
+
*
|
|
20
|
+
* @param _event - Must be "span". Exists for API consistency with BeraMonitoring.
|
|
21
|
+
* @param handler - A StartSpanFn, e.g. Sentry.startSpan.
|
|
22
|
+
* @returns An unsubscribe function to remove the handler.
|
|
23
|
+
*/
|
|
24
|
+
addSpanHandler(handler) {
|
|
25
|
+
_handlers.push(handler);
|
|
26
|
+
return () => {
|
|
27
|
+
const idx = _handlers.indexOf(handler);
|
|
28
|
+
if (idx !== -1) _handlers.splice(idx, 1);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
BeraTracing
|
|
35
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BeraError
|
|
3
|
+
} from "./chunk-J5I45WGQ.mjs";
|
|
4
|
+
|
|
5
|
+
// src/errors/NotFoundError.ts
|
|
6
|
+
var NotFoundError = class extends BeraError {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the resource that was not found.
|
|
9
|
+
*
|
|
10
|
+
* @example "Reward vault"
|
|
11
|
+
*/
|
|
12
|
+
resource;
|
|
13
|
+
/**
|
|
14
|
+
* The id of the resource that was not found.
|
|
15
|
+
*
|
|
16
|
+
* @example "0x1234567890123456789012345678901234567890"
|
|
17
|
+
*/
|
|
18
|
+
id;
|
|
19
|
+
constructor(args) {
|
|
20
|
+
super(args);
|
|
21
|
+
this.name = "NotFoundError";
|
|
22
|
+
this.level = args.level ?? "info";
|
|
23
|
+
this.message = `Resource ${args.resource} with id ${args.id} not found`;
|
|
24
|
+
this.resource = args.resource;
|
|
25
|
+
this.id = args.id;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// src/errors/TransactionFailedError.ts
|
|
30
|
+
var TransactionFailedError = class extends BeraError {
|
|
31
|
+
/**
|
|
32
|
+
* The hash of the transaction that failed.
|
|
33
|
+
*
|
|
34
|
+
* Null if the error is due to a simulation failure.
|
|
35
|
+
*/
|
|
36
|
+
txHash;
|
|
37
|
+
/**
|
|
38
|
+
* The receipt of the transaction that failed.
|
|
39
|
+
*
|
|
40
|
+
* Null if the error is due to a simulation failure.
|
|
41
|
+
*/
|
|
42
|
+
receipt;
|
|
43
|
+
/**
|
|
44
|
+
* The address of the contract that was called.
|
|
45
|
+
*/
|
|
46
|
+
to;
|
|
47
|
+
/**
|
|
48
|
+
* The data of the transaction that failed.
|
|
49
|
+
*/
|
|
50
|
+
callData;
|
|
51
|
+
/**
|
|
52
|
+
* The block number of the transaction that failed.
|
|
53
|
+
*/
|
|
54
|
+
blockNumber = null;
|
|
55
|
+
/**
|
|
56
|
+
* The input of the transaction that failed.
|
|
57
|
+
*/
|
|
58
|
+
input;
|
|
59
|
+
/**
|
|
60
|
+
* The function name of the transaction that failed.
|
|
61
|
+
*/
|
|
62
|
+
functionName;
|
|
63
|
+
constructor(args) {
|
|
64
|
+
super(args);
|
|
65
|
+
this.name = "TransactionFailedError";
|
|
66
|
+
this.txHash = args.txHash || null;
|
|
67
|
+
this.receipt = args.receipt || null;
|
|
68
|
+
this.to = args.to;
|
|
69
|
+
this.functionName = args.functionName;
|
|
70
|
+
this.blockNumber = args.blockNumber ?? null;
|
|
71
|
+
this.input = args.input;
|
|
72
|
+
if (this.receipt) {
|
|
73
|
+
this.message = `Transaction reverted on chain for reason: ${this.reason}`;
|
|
74
|
+
} else if (this.txHash) {
|
|
75
|
+
this.message = `Transaction reverted after being broadcasted for reason: ${this.reason}`;
|
|
76
|
+
} else {
|
|
77
|
+
this.message = `${this.reason}: ${this.message}`;
|
|
78
|
+
}
|
|
79
|
+
this.tags = {
|
|
80
|
+
...this.tags,
|
|
81
|
+
"operation.txn.status": args.txHash ? "execution" : "simulation",
|
|
82
|
+
...args.tags
|
|
83
|
+
};
|
|
84
|
+
if (this.to) {
|
|
85
|
+
this.tags["operation.txn.to"] = this.to;
|
|
86
|
+
}
|
|
87
|
+
if (this.functionName) {
|
|
88
|
+
this.tags["operation.txn.functionName"] = this.functionName;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
NotFoundError,
|
|
95
|
+
TransactionFailedError
|
|
96
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BeraError,
|
|
3
|
+
errorMsgMap,
|
|
4
|
+
httpStatusToSpanStatus,
|
|
5
|
+
reasonToSpanStatus
|
|
6
|
+
} from "./chunk-J5I45WGQ.mjs";
|
|
7
|
+
|
|
8
|
+
// src/errors/RequestError.ts
|
|
9
|
+
import { getUriFromLink } from "@berachain/config";
|
|
10
|
+
import { mainnet } from "@berachain/config/mainnet";
|
|
11
|
+
var RequestError = class _RequestError extends BeraError {
|
|
12
|
+
/**
|
|
13
|
+
* The error response from the request.
|
|
14
|
+
*/
|
|
15
|
+
response;
|
|
16
|
+
static isCorsError(error) {
|
|
17
|
+
return error.cause instanceof Response && error.cause.type === "cors";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The endpoint that was requested.
|
|
21
|
+
*/
|
|
22
|
+
endpoint;
|
|
23
|
+
/**
|
|
24
|
+
* A list of domains that should have their query params removed.
|
|
25
|
+
*/
|
|
26
|
+
queryRichfulDomains = [
|
|
27
|
+
mainnet.bex.aggregatorsProxyUrl,
|
|
28
|
+
"https://api.fly.trade/aggregator/quote",
|
|
29
|
+
"https://open-api.openocean.finance/v4/bera/swap",
|
|
30
|
+
// vercel internal proxy
|
|
31
|
+
"/api/aggregators?aggregator",
|
|
32
|
+
// bonder endpoints have date-based query params (e.g. ?start=2025-11-28)
|
|
33
|
+
mainnet.backend
|
|
34
|
+
];
|
|
35
|
+
statusCode;
|
|
36
|
+
payload;
|
|
37
|
+
static REASON_MAP = {
|
|
38
|
+
429: "RATE_LIMITED_429",
|
|
39
|
+
NETWORK_ERROR: "NETWORK_ERROR",
|
|
40
|
+
CORS_ERROR: "CORS"
|
|
41
|
+
};
|
|
42
|
+
constructor(args) {
|
|
43
|
+
super(args);
|
|
44
|
+
this.name = "RequestError";
|
|
45
|
+
this.response = args.response;
|
|
46
|
+
this.payload = args.payload;
|
|
47
|
+
this.endpoint = this.setEndpoint(args.endpoint);
|
|
48
|
+
if (!this.message && typeof this.cause === "object" && this.cause !== null) {
|
|
49
|
+
if ("error" in this.cause && typeof this.cause.error === "string") {
|
|
50
|
+
this.message = this.cause.error;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (args.statusCode) {
|
|
54
|
+
this.statusCode = args.statusCode;
|
|
55
|
+
} else if (this.response instanceof Response) {
|
|
56
|
+
this.statusCode = this.response.status;
|
|
57
|
+
}
|
|
58
|
+
if (this.statusCode === 429) {
|
|
59
|
+
this.reason = _RequestError.REASON_MAP[429];
|
|
60
|
+
this.displayMessage = errorMsgMap.HTTP.RATE_LIMITED_429.errorMSG;
|
|
61
|
+
this.level = args.level ?? "warning";
|
|
62
|
+
} else {
|
|
63
|
+
const networkError = this.tryMatchNetworkError();
|
|
64
|
+
if (networkError) {
|
|
65
|
+
this.reason = this.reason ?? networkError.reason;
|
|
66
|
+
this.level = args.level ?? "warning";
|
|
67
|
+
this.endpoint.url = this.endpoint.url ?? networkError.url;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (!this.spanStatus && this.reason) {
|
|
71
|
+
this.spanStatus = reasonToSpanStatus(this.reason);
|
|
72
|
+
}
|
|
73
|
+
if (!this.spanStatus && this.statusCode) {
|
|
74
|
+
this.spanStatus = httpStatusToSpanStatus(this.statusCode);
|
|
75
|
+
}
|
|
76
|
+
this.tags = {
|
|
77
|
+
...this.tags,
|
|
78
|
+
"error.statusCode": this.statusCode,
|
|
79
|
+
"operation.type": "query",
|
|
80
|
+
...args.tags
|
|
81
|
+
};
|
|
82
|
+
let message = "";
|
|
83
|
+
if (this.reason) {
|
|
84
|
+
message += `${this.reason} \u2013 `;
|
|
85
|
+
} else if (this.statusCode && this.statusCode >= 400) {
|
|
86
|
+
message += `HTTP ${this.statusCode} \u2013 `;
|
|
87
|
+
}
|
|
88
|
+
const endpointLabel = this.endpoint.type ? `${this.endpoint.type}(${this.endpoint.url})` : this.endpoint.url;
|
|
89
|
+
this.message = `${message}${endpointLabel}: ${this.message}`;
|
|
90
|
+
}
|
|
91
|
+
setEndpoint(endpoint) {
|
|
92
|
+
if (typeof endpoint === "string" || endpoint instanceof URL) {
|
|
93
|
+
this.endpoint = {
|
|
94
|
+
url: typeof endpoint === "string" ? endpoint : endpoint.toString()
|
|
95
|
+
};
|
|
96
|
+
} else {
|
|
97
|
+
this.endpoint = {
|
|
98
|
+
...this.endpoint,
|
|
99
|
+
...endpoint,
|
|
100
|
+
url: endpoint.url.toString()
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (this.queryRichfulDomains.some(
|
|
104
|
+
(domain) => this.endpoint.url.includes(getUriFromLink(domain))
|
|
105
|
+
)) {
|
|
106
|
+
try {
|
|
107
|
+
const url = new URL(this.endpoint.url);
|
|
108
|
+
url.search = "";
|
|
109
|
+
this.endpoint.url = url.toString();
|
|
110
|
+
} catch {
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
this.tags = {
|
|
114
|
+
...this.tags,
|
|
115
|
+
"operation.source.url": this.endpoint.url,
|
|
116
|
+
"operation.source.name": this.endpoint.name,
|
|
117
|
+
"operation.source.type": this.endpoint.type
|
|
118
|
+
};
|
|
119
|
+
return this.endpoint;
|
|
120
|
+
}
|
|
121
|
+
tryMatchNetworkError() {
|
|
122
|
+
if (this.cause instanceof Error && "message" in this.cause && typeof this.cause.message === "string" || this.cause instanceof TypeError) {
|
|
123
|
+
const message = this.cause.message;
|
|
124
|
+
if (message.startsWith("Network Error")) {
|
|
125
|
+
return {
|
|
126
|
+
reason: _RequestError.REASON_MAP.NETWORK_ERROR,
|
|
127
|
+
message,
|
|
128
|
+
url: this.endpoint.url
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const failedToFetchMatch = message.match(
|
|
132
|
+
/^(?:NetworkError when attempting to fetch resource\.|Failed to fetch|Load failed) \(([a-z0-9-.]+)\)$/
|
|
133
|
+
);
|
|
134
|
+
if (failedToFetchMatch) {
|
|
135
|
+
return {
|
|
136
|
+
reason: _RequestError.REASON_MAP.NETWORK_ERROR,
|
|
137
|
+
message,
|
|
138
|
+
url: failedToFetchMatch[1]
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (typeof this.cause === "object" && this.cause !== null && "message" in this.cause && typeof this.cause.message === "string") {
|
|
143
|
+
const message = this.cause.message;
|
|
144
|
+
if (message.startsWith(
|
|
145
|
+
"error: canceling statement due to lock timeout occurred in"
|
|
146
|
+
)) {
|
|
147
|
+
return {
|
|
148
|
+
reason: _RequestError.REASON_MAP.NETWORK_ERROR,
|
|
149
|
+
message,
|
|
150
|
+
url: this.endpoint.url
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export {
|
|
159
|
+
RequestError
|
|
160
|
+
};
|
|
@@ -4,8 +4,8 @@ import { B as BeraFlags } from '../defaultFlags-D6KfkTZx.js';
|
|
|
4
4
|
export { B as BexStateContext, a as BexStatusProvider, b as BexStatusProviderProps, u as useBexStatus } from '../BexStatusProvider-DRymVlQf.js';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import react__default, { PropsWithChildren } from 'react';
|
|
7
|
-
import { a as TokenWithMetadata, b as Token, B as BalanceToken } from '../HoneyConfigProvider-
|
|
8
|
-
export { c as HoneyConfigContext, d as HoneyConfigContextReturn, e as HoneyConfigProvider, f as HoneyConfigProviderProps, T as TokenWithOrder, u as useHoneyConfig } from '../HoneyConfigProvider-
|
|
7
|
+
import { a as TokenWithMetadata, b as Token, B as BalanceToken } from '../HoneyConfigProvider-Dkj-_a5x.js';
|
|
8
|
+
export { c as HoneyConfigContext, d as HoneyConfigContextReturn, e as HoneyConfigProvider, f as HoneyConfigProviderProps, T as TokenWithOrder, u as useHoneyConfig } from '../HoneyConfigProvider-Dkj-_a5x.js';
|
|
9
9
|
import '@berachain/config/internal/flags';
|
|
10
10
|
import 'viem';
|
|
11
11
|
import '@berachain/graphql/pol/api';
|
|
@@ -1,2 +1,85 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
BeraFlagsProvider,
|
|
4
|
+
BexStateContext,
|
|
5
|
+
BexStatusProvider,
|
|
6
|
+
BlockTimeContext,
|
|
7
|
+
BlockTimeProvider,
|
|
8
|
+
HoneyConfigContext,
|
|
9
|
+
HoneyConfigProvider,
|
|
10
|
+
TokenContext,
|
|
11
|
+
TokensProvider,
|
|
12
|
+
useBeraFlag,
|
|
13
|
+
useBeraFlags,
|
|
14
|
+
useBexStatus,
|
|
15
|
+
useBlockTime,
|
|
16
|
+
useHoneyConfig
|
|
17
|
+
} from "../chunk-3EARVV7K.mjs";
|
|
18
|
+
import "../chunk-HSSJKHZ4.mjs";
|
|
19
|
+
import "../chunk-HQCOU6GY.mjs";
|
|
20
|
+
import "../chunk-SGIJVHZO.mjs";
|
|
21
|
+
import {
|
|
22
|
+
BeraMonitoring
|
|
23
|
+
} from "../chunk-EXIUPSFN.mjs";
|
|
24
|
+
import "../chunk-KQUMKB66.mjs";
|
|
25
|
+
import "../chunk-BGMRHTBQ.mjs";
|
|
26
|
+
import "../chunk-NPBQLVL3.mjs";
|
|
27
|
+
import "../chunk-75M6TF7M.mjs";
|
|
28
|
+
import "../chunk-XIYN6AL6.mjs";
|
|
29
|
+
import {
|
|
30
|
+
BeraError
|
|
31
|
+
} from "../chunk-J5I45WGQ.mjs";
|
|
32
|
+
|
|
33
|
+
// src/contexts/SwrFallback.tsx
|
|
34
|
+
import { useEffect } from "react";
|
|
35
|
+
import { SWRConfig } from "swr";
|
|
36
|
+
import { jsx } from "react/jsx-runtime";
|
|
37
|
+
function SWRFallback({
|
|
38
|
+
fallback,
|
|
39
|
+
children
|
|
40
|
+
}) {
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
Object.entries(fallback).some(([key, value]) => {
|
|
43
|
+
if (!key) {
|
|
44
|
+
console.warn("SWRFallback", key, value);
|
|
45
|
+
BeraMonitoring.captureException(
|
|
46
|
+
new BeraError({
|
|
47
|
+
message: "Empty key in SWRFallback. This will lead to wrong query returns when key is null. Should be reported to SWR.",
|
|
48
|
+
level: "warning",
|
|
49
|
+
extra: {
|
|
50
|
+
key,
|
|
51
|
+
value
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
return true;
|
|
56
|
+
} else return false;
|
|
57
|
+
});
|
|
58
|
+
}, [fallback]);
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
SWRConfig,
|
|
61
|
+
{
|
|
62
|
+
value: {
|
|
63
|
+
fallback
|
|
64
|
+
},
|
|
65
|
+
children
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
BeraFlagsProvider,
|
|
71
|
+
BexStateContext,
|
|
72
|
+
BexStatusProvider,
|
|
73
|
+
BlockTimeContext,
|
|
74
|
+
BlockTimeProvider,
|
|
75
|
+
HoneyConfigContext,
|
|
76
|
+
HoneyConfigProvider,
|
|
77
|
+
SWRFallback,
|
|
78
|
+
TokenContext,
|
|
79
|
+
TokensProvider,
|
|
80
|
+
useBeraFlag,
|
|
81
|
+
useBeraFlags,
|
|
82
|
+
useBexStatus,
|
|
83
|
+
useBlockTime,
|
|
84
|
+
useHoneyConfig
|
|
85
|
+
};
|
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-ByI5dtDi.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,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Aggregators,
|
|
3
|
+
ContractName,
|
|
4
|
+
HoneySwapAction,
|
|
5
|
+
OwnershipType,
|
|
6
|
+
ParameterPreset,
|
|
7
|
+
PoolCreationStep,
|
|
8
|
+
SwapReferrer,
|
|
9
|
+
TransactionActionType
|
|
10
|
+
} from "../chunk-O2NQFKJK.mjs";
|
|
11
|
+
import {
|
|
12
|
+
POLLING
|
|
13
|
+
} from "../chunk-SGIJVHZO.mjs";
|
|
14
|
+
|
|
15
|
+
// src/enum/slippage.ts
|
|
16
|
+
var DEFAULT_SLIPPAGE = 0.5;
|
|
17
|
+
var SLIPPAGE_DEGEN_VALUE = 25;
|
|
18
|
+
var DEFAULT_DEADLINE = 60;
|
|
19
|
+
var SLIPPAGE_MODE = /* @__PURE__ */ ((SLIPPAGE_MODE2) => {
|
|
20
|
+
SLIPPAGE_MODE2["AUTO"] = "auto";
|
|
21
|
+
SLIPPAGE_MODE2["CUSTOM"] = "custom";
|
|
22
|
+
SLIPPAGE_MODE2["DEGEN"] = "degen";
|
|
23
|
+
return SLIPPAGE_MODE2;
|
|
24
|
+
})(SLIPPAGE_MODE || {});
|
|
25
|
+
var TRANSACTION_MODE = /* @__PURE__ */ ((TRANSACTION_MODE2) => {
|
|
26
|
+
TRANSACTION_MODE2["AUTO"] = "auto";
|
|
27
|
+
TRANSACTION_MODE2["CUSTOM"] = "custom";
|
|
28
|
+
TRANSACTION_MODE2["INFINITY"] = "infinity";
|
|
29
|
+
return TRANSACTION_MODE2;
|
|
30
|
+
})(TRANSACTION_MODE || {});
|
|
31
|
+
export {
|
|
32
|
+
Aggregators,
|
|
33
|
+
ContractName,
|
|
34
|
+
DEFAULT_DEADLINE,
|
|
35
|
+
DEFAULT_SLIPPAGE,
|
|
36
|
+
HoneySwapAction,
|
|
37
|
+
OwnershipType,
|
|
38
|
+
POLLING,
|
|
39
|
+
ParameterPreset,
|
|
40
|
+
PoolCreationStep,
|
|
41
|
+
SLIPPAGE_DEGEN_VALUE,
|
|
42
|
+
SLIPPAGE_MODE,
|
|
43
|
+
SwapReferrer,
|
|
44
|
+
TRANSACTION_MODE,
|
|
45
|
+
TransactionActionType
|
|
46
|
+
};
|
|
@@ -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 };
|
package/dist/errors/exports.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { GetPublicClientReturnType } from '@wagmi/core';
|
|
2
2
|
import { Address, PublicClient, TransactionReceipt } from 'viem';
|
|
3
|
-
import { B as BeraError, S as SeverityLevel, I as IBeraErrorArgs } from '../BeraError-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { B as BeraError, S as SeverityLevel, I as IBeraErrorArgs } from '../BeraError-7-A5JYy_.js';
|
|
4
|
+
export { a as SpanStatusType, h as httpStatusToSpanStatus, r as reasonToSpanStatus } from '../BeraError-7-A5JYy_.js';
|
|
5
|
+
import { E as EmitterMixin } from '../RequestError-DBOIV65x.js';
|
|
6
|
+
export { B as BeraTracing, R as RequestError, S as SpanContext } from '../RequestError-DBOIV65x.js';
|
|
6
7
|
import { Hex } from '@berachain-foundation/berancer-sdk';
|
|
7
8
|
import '@apollo/client';
|
|
8
9
|
|
package/dist/errors/exports.mjs
CHANGED
|
@@ -1,2 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
NotFoundError,
|
|
3
|
+
TransactionFailedError
|
|
4
|
+
} from "../chunk-WXXOISTU.mjs";
|
|
5
|
+
import {
|
|
6
|
+
BeraMonitoring,
|
|
7
|
+
initBeraError
|
|
8
|
+
} from "../chunk-EXIUPSFN.mjs";
|
|
9
|
+
import {
|
|
10
|
+
assertAddress,
|
|
11
|
+
assertAmount,
|
|
12
|
+
assertDefined,
|
|
13
|
+
assertPositive,
|
|
14
|
+
assertPublicClient
|
|
15
|
+
} from "../chunk-KQUMKB66.mjs";
|
|
16
|
+
import {
|
|
17
|
+
BeraTracing
|
|
18
|
+
} from "../chunk-SZ5C44L5.mjs";
|
|
19
|
+
import {
|
|
20
|
+
RequestError
|
|
21
|
+
} from "../chunk-XIYN6AL6.mjs";
|
|
22
|
+
import {
|
|
23
|
+
BeraError,
|
|
24
|
+
InvalidArgumentError,
|
|
25
|
+
findMatchingError,
|
|
26
|
+
getErrorMessage,
|
|
27
|
+
httpStatusToSpanStatus,
|
|
28
|
+
reasonToSpanStatus
|
|
29
|
+
} from "../chunk-J5I45WGQ.mjs";
|
|
30
|
+
export {
|
|
31
|
+
BeraError,
|
|
32
|
+
BeraMonitoring,
|
|
33
|
+
BeraTracing,
|
|
34
|
+
InvalidArgumentError,
|
|
35
|
+
NotFoundError,
|
|
36
|
+
RequestError,
|
|
37
|
+
TransactionFailedError,
|
|
38
|
+
assertAddress,
|
|
39
|
+
assertAmount,
|
|
40
|
+
assertDefined,
|
|
41
|
+
assertPositive,
|
|
42
|
+
assertPublicClient,
|
|
43
|
+
findMatchingError,
|
|
44
|
+
getErrorMessage,
|
|
45
|
+
httpStatusToSpanStatus,
|
|
46
|
+
initBeraError,
|
|
47
|
+
reasonToSpanStatus
|
|
48
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ApolloClient, OperationVariables } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This is a wrapper around the ApolloClient that throws a BeraError if the query returns an error or no data.
|
|
5
|
+
*
|
|
6
|
+
* It's mostly a typescript helper that keeps data always defined since we use errorPolicy: "none" by default.
|
|
7
|
+
* Such setting will throw an error if the query returns an error, rather than returning an object with undefined data and an error property.
|
|
8
|
+
*/
|
|
9
|
+
declare class BeraApolloClient extends ApolloClient {
|
|
10
|
+
/**
|
|
11
|
+
* The URL of the endpoint. Used for error reporting only.
|
|
12
|
+
*/
|
|
13
|
+
protected url: string;
|
|
14
|
+
protected serviceName: string;
|
|
15
|
+
constructor(options: ApolloClient.Options & {
|
|
16
|
+
/**
|
|
17
|
+
* The URL of the endpoint. Used for error reporting only.
|
|
18
|
+
*/
|
|
19
|
+
url: string;
|
|
20
|
+
/**
|
|
21
|
+
* The name of the graphql service. Used for error reporting only.
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
});
|
|
25
|
+
query<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: Omit<ApolloClient.QueryOptions<TData, TVariables>, "errorPolicy">): Promise<{
|
|
26
|
+
data: TData;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Browser-reachable Apollo client factory for `api` and Bend's `whisk`
|
|
32
|
+
* endpoints. Subgraph clients (honey/pol) are server-only; browser data
|
|
33
|
+
* access goes through the typed `/api/honey/*` and `/api/pol/*` REST
|
|
34
|
+
* endpoints. Same auth shape as bend.whiskApi — non-public env values only
|
|
35
|
+
* resolve server-side.
|
|
36
|
+
*/
|
|
37
|
+
type GraphqlClient = "api" | "bend.whisk" | "honey.subgraph" | "pol.subgraph";
|
|
38
|
+
declare function getApolloClient(clientName: GraphqlClient, { ...args }: BeraJS.BaseFunctionArgs): BeraApolloClient;
|
|
39
|
+
|
|
40
|
+
export { BeraApolloClient as B, getApolloClient as g };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Address, PublicClient, Hex } from 'viem';
|
|
2
2
|
import { BeraConfig, ChainId } from '@berachain/config/internal';
|
|
3
|
-
import { I as IAggregatorArgs, g as IRawAggregatorQuote, b as Token, d as HoneyConfigContextReturn, B as BalanceToken, P as PythLatestUpdates } from './HoneyConfigProvider-
|
|
3
|
+
import { I as IAggregatorArgs, g as IRawAggregatorQuote, b as Token, d as HoneyConfigContextReturn, B as BalanceToken, P as PythLatestUpdates } from './HoneyConfigProvider-Dkj-_a5x.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-CqPA9K6m.js';
|
|
7
7
|
|
|
8
8
|
interface GetConvertToAssetsProps {
|
|
9
9
|
sharesAmount: bigint;
|