@berachain/berajs 0.2.8-beta.8 → 0.2.8-beta.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/RequestError-BRIiJgHk.d.ts +144 -0
- package/dist/RequestError-DSUzJ1Iy.d.cts +144 -0
- package/dist/abi/exports.cjs +1 -4452
- package/dist/abi/exports.cjs.map +1 -1
- package/dist/abi/exports.mjs +1 -4452
- package/dist/abi/exports.mjs.map +1 -1
- package/dist/actions/exports.cjs +1 -913
- package/dist/actions/exports.cjs.map +1 -1
- package/dist/actions/exports.d.cts +11 -5
- package/dist/actions/exports.d.ts +11 -5
- package/dist/actions/exports.mjs +1 -913
- package/dist/actions/exports.mjs.map +1 -1
- package/dist/chunk-45HIEVNI.cjs +4 -0
- package/dist/chunk-45HIEVNI.cjs.map +1 -0
- package/dist/chunk-47ILYVHC.mjs +2 -0
- package/dist/{chunk-SGZP4O6R.mjs.map → chunk-47ILYVHC.mjs.map} +1 -1
- package/dist/chunk-575OK77P.mjs +2 -0
- package/dist/{chunk-GLWPRM33.mjs.map → chunk-575OK77P.mjs.map} +1 -1
- package/dist/chunk-5NVZG5N6.mjs +2 -0
- package/dist/{chunk-4GFN4LEP.mjs.map → chunk-5NVZG5N6.mjs.map} +1 -1
- package/dist/chunk-6DIA6PXV.cjs +2 -0
- package/dist/chunk-6DIA6PXV.cjs.map +1 -0
- package/dist/chunk-6JJIZCVY.cjs +2 -0
- package/dist/chunk-6JJIZCVY.cjs.map +1 -0
- package/dist/chunk-7F72ZH4Q.mjs +2 -0
- package/dist/{chunk-VA5L5FDG.mjs.map → chunk-7F72ZH4Q.mjs.map} +1 -1
- package/dist/chunk-AUA42YIG.mjs +4 -0
- package/dist/chunk-AUA42YIG.mjs.map +1 -0
- package/dist/chunk-BC2WX6O6.cjs +2 -0
- package/dist/chunk-BC2WX6O6.cjs.map +1 -0
- package/dist/chunk-CJOZC5Z2.cjs +2 -0
- package/dist/chunk-CJOZC5Z2.cjs.map +1 -0
- package/dist/chunk-D6L7LTA2.cjs +2 -0
- package/dist/chunk-D6L7LTA2.cjs.map +1 -0
- package/dist/chunk-DDEQFR3M.cjs +2 -0
- package/dist/chunk-DDEQFR3M.cjs.map +1 -0
- package/dist/chunk-GXV2JA36.mjs +2 -0
- package/dist/{chunk-7QKRRIHI.mjs.map → chunk-GXV2JA36.mjs.map} +1 -1
- package/dist/chunk-ISYNEDET.mjs +2 -0
- package/dist/{chunk-VA3BQ34H.mjs.map → chunk-ISYNEDET.mjs.map} +1 -1
- package/dist/chunk-JDDRTHFG.mjs +2 -0
- package/dist/chunk-JDDRTHFG.mjs.map +1 -0
- package/dist/chunk-JDZGYU5T.mjs +2 -0
- package/dist/{chunk-I3FTWD6I.mjs.map → chunk-JDZGYU5T.mjs.map} +1 -1
- package/dist/chunk-LVOXBZMA.cjs +2 -0
- package/dist/chunk-LVOXBZMA.cjs.map +1 -0
- package/dist/chunk-MK5NS5B5.mjs +2 -0
- package/dist/{chunk-7TFV6UKF.mjs.map → chunk-MK5NS5B5.mjs.map} +1 -1
- package/dist/chunk-NAXAZJJY.mjs +2 -0
- package/dist/{chunk-ZCEFC2TK.mjs.map → chunk-NAXAZJJY.mjs.map} +1 -1
- package/dist/chunk-NLVWRMGD.mjs +2 -0
- package/dist/{chunk-GWSTVITN.mjs.map → chunk-NLVWRMGD.mjs.map} +1 -1
- package/dist/chunk-OGBD5YOG.mjs +2 -0
- package/dist/{chunk-JA4DHMTG.mjs.map → chunk-OGBD5YOG.mjs.map} +1 -1
- package/dist/chunk-OGJMSGB2.mjs +2 -0
- package/dist/{chunk-KL6YZ5VR.mjs.map → chunk-OGJMSGB2.mjs.map} +1 -1
- package/dist/chunk-OIYXOKTT.cjs +2 -0
- package/dist/chunk-OIYXOKTT.cjs.map +1 -0
- package/dist/chunk-OUD27MU7.cjs +2 -0
- package/dist/chunk-OUD27MU7.cjs.map +1 -0
- package/dist/chunk-PRLVZIKD.mjs +2 -0
- package/dist/chunk-PRLVZIKD.mjs.map +1 -0
- package/dist/chunk-Q2SNRLW3.cjs +2 -0
- package/dist/chunk-Q2SNRLW3.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 +2 -0
- package/dist/chunk-RWOICHRW.cjs.map +1 -0
- package/dist/chunk-S4CDSVLK.cjs +2 -0
- package/dist/chunk-S4CDSVLK.cjs.map +1 -0
- package/dist/chunk-SFEULGSX.cjs +2 -0
- package/dist/chunk-SFEULGSX.cjs.map +1 -0
- package/dist/chunk-WBTS6KFG.mjs +2 -0
- package/dist/{chunk-ZBTRKBSI.mjs.map → chunk-WBTS6KFG.mjs.map} +1 -1
- package/dist/chunk-WRFDB3QJ.cjs +2 -0
- package/dist/chunk-WRFDB3QJ.cjs.map +1 -0
- package/dist/chunk-XNJLSA6P.cjs +2 -0
- package/dist/chunk-XNJLSA6P.cjs.map +1 -0
- package/dist/contexts/exports.cjs +1 -82
- package/dist/contexts/exports.cjs.map +1 -1
- package/dist/contexts/exports.mjs +1 -82
- package/dist/contexts/exports.mjs.map +1 -1
- package/dist/enum/exports.cjs +1 -58
- package/dist/enum/exports.cjs.map +1 -1
- package/dist/enum/exports.mjs +1 -58
- package/dist/enum/exports.mjs.map +1 -1
- package/dist/errors/exports.cjs +1 -38
- 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 -38
- package/dist/hooks/exports.cjs +3 -8332
- package/dist/hooks/exports.cjs.map +1 -1
- package/dist/hooks/exports.d.cts +13 -27
- package/dist/hooks/exports.d.ts +13 -27
- package/dist/hooks/exports.mjs +3 -8332
- package/dist/hooks/exports.mjs.map +1 -1
- package/dist/utils/exports.cjs +1 -786
- 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 -786
- package/dist/utils/exports.mjs.map +1 -1
- package/package.json +14 -3
- package/src/actions/clients/BeraApolloClient.ts +9 -0
- package/src/actions/clients/getApolloClient.ts +12 -2
- package/src/actions/dex/aggregators/base.ts +1 -1
- package/src/actions/exports.ts +1 -1
- package/src/actions/honey/getChartData.ts +5 -5
- package/src/actions/honey/getHoney24hVolume.ts +30 -0
- package/src/actions/pol/getEarnedStakedBeraVault.ts +12 -2
- package/src/actions/pol/getStakingDailyAssets.ts +7 -1
- package/src/data/contracts.ts +5 -0
- package/src/errors/RequestError.ts +2 -1
- package/src/hooks/exports.ts +1 -1
- package/src/hooks/honey/useHoney24hVolume.ts +16 -0
- package/src/utils/beraFetch.ts +70 -15
- package/dist/RequestError-A8XJ6QR9.d.cts +0 -57
- package/dist/RequestError-Dk97z8rm.d.ts +0 -57
- package/dist/chunk-2R73G2PO.mjs +0 -4698
- package/dist/chunk-2R73G2PO.mjs.map +0 -1
- package/dist/chunk-3M47ZRXT.mjs +0 -417
- package/dist/chunk-3M47ZRXT.mjs.map +0 -1
- package/dist/chunk-4GFN4LEP.mjs +0 -97
- package/dist/chunk-5N7QQS55.cjs +0 -130
- package/dist/chunk-5N7QQS55.cjs.map +0 -1
- package/dist/chunk-5NMATIH4.mjs +0 -130
- package/dist/chunk-5NMATIH4.mjs.map +0 -1
- package/dist/chunk-7QKRRIHI.mjs +0 -1844
- package/dist/chunk-7TFV6UKF.mjs +0 -24
- package/dist/chunk-A4FPM7U3.cjs +0 -63
- package/dist/chunk-A4FPM7U3.cjs.map +0 -1
- package/dist/chunk-BDHINMWQ.cjs +0 -417
- package/dist/chunk-BDHINMWQ.cjs.map +0 -1
- package/dist/chunk-BEHP54S3.cjs +0 -24
- package/dist/chunk-BEHP54S3.cjs.map +0 -1
- package/dist/chunk-EGDXV2PT.cjs +0 -36
- package/dist/chunk-EGDXV2PT.cjs.map +0 -1
- package/dist/chunk-EWBKSMPG.cjs +0 -13
- package/dist/chunk-EWBKSMPG.cjs.map +0 -1
- package/dist/chunk-F6ZW7ZDD.cjs +0 -403
- package/dist/chunk-F6ZW7ZDD.cjs.map +0 -1
- package/dist/chunk-FTXTRUYT.cjs +0 -170
- package/dist/chunk-FTXTRUYT.cjs.map +0 -1
- package/dist/chunk-GLWPRM33.mjs +0 -13
- package/dist/chunk-GWSTVITN.mjs +0 -572
- package/dist/chunk-H3Z37RYU.cjs +0 -15
- package/dist/chunk-H3Z37RYU.cjs.map +0 -1
- package/dist/chunk-I3FTWD6I.mjs +0 -170
- package/dist/chunk-JA4DHMTG.mjs +0 -15
- package/dist/chunk-KL6YZ5VR.mjs +0 -63
- package/dist/chunk-MXWPP6MS.cjs +0 -572
- package/dist/chunk-MXWPP6MS.cjs.map +0 -1
- package/dist/chunk-SGZP4O6R.mjs +0 -135
- package/dist/chunk-TDW5SPXR.cjs +0 -244
- package/dist/chunk-TDW5SPXR.cjs.map +0 -1
- package/dist/chunk-TGK3IXDN.cjs +0 -169
- package/dist/chunk-TGK3IXDN.cjs.map +0 -1
- package/dist/chunk-TJEW6YCJ.cjs +0 -97
- package/dist/chunk-TJEW6YCJ.cjs.map +0 -1
- package/dist/chunk-VA3BQ34H.mjs +0 -403
- package/dist/chunk-VA5L5FDG.mjs +0 -36
- package/dist/chunk-XSGCRLSD.cjs +0 -1844
- package/dist/chunk-XSGCRLSD.cjs.map +0 -1
- package/dist/chunk-XV3GG3HC.cjs +0 -135
- package/dist/chunk-XV3GG3HC.cjs.map +0 -1
- package/dist/chunk-Y5B224UX.cjs +0 -4698
- package/dist/chunk-Y5B224UX.cjs.map +0 -1
- package/dist/chunk-ZBTRKBSI.mjs +0 -169
- package/dist/chunk-ZCEFC2TK.mjs +0 -244
- package/src/actions/honey/getHoneyGlobalData.ts +0 -21
- package/src/hooks/honey/useHoneyGlobalData.ts +0 -23
package/dist/chunk-ZBTRKBSI.mjs
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BeraError,
|
|
3
|
-
InvalidArgumentError,
|
|
4
|
-
RequestError,
|
|
5
|
-
parseViemError
|
|
6
|
-
} from "./chunk-7QKRRIHI.mjs";
|
|
7
|
-
|
|
8
|
-
// src/errors/initBeraError.ts
|
|
9
|
-
import { BaseError } from "viem";
|
|
10
|
-
function initBeraError({
|
|
11
|
-
cause: error,
|
|
12
|
-
level
|
|
13
|
-
}) {
|
|
14
|
-
if (error instanceof BaseError) {
|
|
15
|
-
const parsed = parseViemError({
|
|
16
|
-
error,
|
|
17
|
-
revertIfUnknown: false
|
|
18
|
-
});
|
|
19
|
-
if (parsed.isRequestError && parsed.rootCause instanceof BaseError && "url" in parsed.rootCause && typeof parsed.rootCause.url === "string") {
|
|
20
|
-
return new RequestError({
|
|
21
|
-
cause: parsed.rootCause,
|
|
22
|
-
response: void 0,
|
|
23
|
-
endpoint: {
|
|
24
|
-
url: parsed.rootCause.url,
|
|
25
|
-
type: "rpc"
|
|
26
|
-
},
|
|
27
|
-
level
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
const err = error instanceof BeraError ? error : new BeraError({
|
|
32
|
-
cause: error,
|
|
33
|
-
level
|
|
34
|
-
});
|
|
35
|
-
return err;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// src/errors/assert.ts
|
|
39
|
-
import { isAddress } from "viem";
|
|
40
|
-
function _isDefined(value) {
|
|
41
|
-
return value !== void 0 && value !== null;
|
|
42
|
-
}
|
|
43
|
-
function _assert({
|
|
44
|
-
value,
|
|
45
|
-
property,
|
|
46
|
-
fn
|
|
47
|
-
}) {
|
|
48
|
-
const result = fn(value);
|
|
49
|
-
if (!result.isValid) {
|
|
50
|
-
throw new InvalidArgumentError({
|
|
51
|
-
property,
|
|
52
|
-
value,
|
|
53
|
-
expected: result.expectedType
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function _assertDefined({
|
|
58
|
-
value,
|
|
59
|
-
property,
|
|
60
|
-
fn
|
|
61
|
-
}) {
|
|
62
|
-
_assert({
|
|
63
|
-
value,
|
|
64
|
-
property,
|
|
65
|
-
fn: (value2) => {
|
|
66
|
-
const isDefined = _isDefined(value2);
|
|
67
|
-
const { isValid, expectedType } = fn(value2);
|
|
68
|
-
return {
|
|
69
|
-
expectedType,
|
|
70
|
-
isValid: isDefined && isValid
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function assertDefined(value, property) {
|
|
76
|
-
_assertDefined({
|
|
77
|
-
value,
|
|
78
|
-
property,
|
|
79
|
-
fn: (value2) => ({ expectedType: "defined", isValid: _isDefined(value2) })
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
function assertPublicClient(value, property = "publicClient") {
|
|
83
|
-
assertDefined(value, property);
|
|
84
|
-
}
|
|
85
|
-
function assertAddress(value, property) {
|
|
86
|
-
_assertDefined({
|
|
87
|
-
value,
|
|
88
|
-
property,
|
|
89
|
-
fn: (value2) => ({
|
|
90
|
-
expectedType: "Address",
|
|
91
|
-
isValid: typeof value2 === "string" && isAddress(value2)
|
|
92
|
-
})
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
function assertPositive(value, property) {
|
|
96
|
-
const isPositive = typeof value === "bigint" ? value > 0n : Number(value) > 0;
|
|
97
|
-
if (!isPositive) {
|
|
98
|
-
throw new InvalidArgumentError({
|
|
99
|
-
property,
|
|
100
|
-
value,
|
|
101
|
-
expected: "positive amount"
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function assertAmount(value, property) {
|
|
106
|
-
_assertDefined({
|
|
107
|
-
value,
|
|
108
|
-
property,
|
|
109
|
-
fn: (value2) => ({
|
|
110
|
-
expectedType: "number",
|
|
111
|
-
isValid: (typeof value2 === "string" || typeof value2 === "number") && Number(value2) > 0
|
|
112
|
-
})
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// src/utils/createEmitter.ts
|
|
117
|
-
function createEmitter() {
|
|
118
|
-
const events = {};
|
|
119
|
-
return {
|
|
120
|
-
emit(event, ...args) {
|
|
121
|
-
for (const callback of events[event] || []) {
|
|
122
|
-
callback(...args);
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
events,
|
|
126
|
-
on(event, cb) {
|
|
127
|
-
if (!events[event]) {
|
|
128
|
-
events[event] = [];
|
|
129
|
-
}
|
|
130
|
-
events[event].push(cb);
|
|
131
|
-
return () => {
|
|
132
|
-
events[event] = events[event]?.filter((i) => cb !== i);
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// src/errors/BeraMonitoring.ts
|
|
139
|
-
var _emitter = createEmitter();
|
|
140
|
-
var BeraMonitoring = {
|
|
141
|
-
/**
|
|
142
|
-
* Capture an exception. Notifies all subscribers.
|
|
143
|
-
*/
|
|
144
|
-
captureException(exception) {
|
|
145
|
-
const event = {
|
|
146
|
-
exception,
|
|
147
|
-
timestamp: Date.now()
|
|
148
|
-
};
|
|
149
|
-
_emitter.emit("exception", event);
|
|
150
|
-
},
|
|
151
|
-
/**
|
|
152
|
-
* Subscribe to error events.
|
|
153
|
-
* @returns An unsubscribe function.
|
|
154
|
-
*/
|
|
155
|
-
on(...args) {
|
|
156
|
-
return _emitter.on(...args);
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export {
|
|
161
|
-
initBeraError,
|
|
162
|
-
assertDefined,
|
|
163
|
-
assertPublicClient,
|
|
164
|
-
assertAddress,
|
|
165
|
-
assertPositive,
|
|
166
|
-
assertAmount,
|
|
167
|
-
BeraMonitoring
|
|
168
|
-
};
|
|
169
|
-
//# sourceMappingURL=chunk-ZBTRKBSI.mjs.map
|
package/dist/chunk-ZCEFC2TK.mjs
DELETED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
// src/abi/utils/multicall3.ts
|
|
2
|
-
var multicall3Abi = [
|
|
3
|
-
{
|
|
4
|
-
inputs: [
|
|
5
|
-
{
|
|
6
|
-
components: [
|
|
7
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
8
|
-
{ internalType: "bytes", name: "callData", type: "bytes" }
|
|
9
|
-
],
|
|
10
|
-
internalType: "struct Multicall3.Call[]",
|
|
11
|
-
name: "calls",
|
|
12
|
-
type: "tuple[]"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
name: "aggregate",
|
|
16
|
-
outputs: [
|
|
17
|
-
{ internalType: "uint256", name: "blockNumber", type: "uint256" },
|
|
18
|
-
{ internalType: "bytes[]", name: "returnData", type: "bytes[]" }
|
|
19
|
-
],
|
|
20
|
-
stateMutability: "payable",
|
|
21
|
-
type: "function"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
inputs: [
|
|
25
|
-
{
|
|
26
|
-
components: [
|
|
27
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
28
|
-
{ internalType: "bool", name: "allowFailure", type: "bool" },
|
|
29
|
-
{ internalType: "bytes", name: "callData", type: "bytes" }
|
|
30
|
-
],
|
|
31
|
-
internalType: "struct Multicall3.Call3[]",
|
|
32
|
-
name: "calls",
|
|
33
|
-
type: "tuple[]"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
name: "aggregate3",
|
|
37
|
-
outputs: [
|
|
38
|
-
{
|
|
39
|
-
components: [
|
|
40
|
-
{ internalType: "bool", name: "success", type: "bool" },
|
|
41
|
-
{ internalType: "bytes", name: "returnData", type: "bytes" }
|
|
42
|
-
],
|
|
43
|
-
internalType: "struct Multicall3.Result[]",
|
|
44
|
-
name: "returnData",
|
|
45
|
-
type: "tuple[]"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
stateMutability: "payable",
|
|
49
|
-
type: "function"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
inputs: [
|
|
53
|
-
{
|
|
54
|
-
components: [
|
|
55
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
56
|
-
{ internalType: "bool", name: "allowFailure", type: "bool" },
|
|
57
|
-
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
58
|
-
{ internalType: "bytes", name: "callData", type: "bytes" }
|
|
59
|
-
],
|
|
60
|
-
internalType: "struct Multicall3.Call3Value[]",
|
|
61
|
-
name: "calls",
|
|
62
|
-
type: "tuple[]"
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
name: "aggregate3Value",
|
|
66
|
-
outputs: [
|
|
67
|
-
{
|
|
68
|
-
components: [
|
|
69
|
-
{ internalType: "bool", name: "success", type: "bool" },
|
|
70
|
-
{ internalType: "bytes", name: "returnData", type: "bytes" }
|
|
71
|
-
],
|
|
72
|
-
internalType: "struct Multicall3.Result[]",
|
|
73
|
-
name: "returnData",
|
|
74
|
-
type: "tuple[]"
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
stateMutability: "payable",
|
|
78
|
-
type: "function"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
inputs: [
|
|
82
|
-
{
|
|
83
|
-
components: [
|
|
84
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
85
|
-
{ internalType: "bytes", name: "callData", type: "bytes" }
|
|
86
|
-
],
|
|
87
|
-
internalType: "struct Multicall3.Call[]",
|
|
88
|
-
name: "calls",
|
|
89
|
-
type: "tuple[]"
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
name: "blockAndAggregate",
|
|
93
|
-
outputs: [
|
|
94
|
-
{ internalType: "uint256", name: "blockNumber", type: "uint256" },
|
|
95
|
-
{ internalType: "bytes32", name: "blockHash", type: "bytes32" },
|
|
96
|
-
{
|
|
97
|
-
components: [
|
|
98
|
-
{ internalType: "bool", name: "success", type: "bool" },
|
|
99
|
-
{ internalType: "bytes", name: "returnData", type: "bytes" }
|
|
100
|
-
],
|
|
101
|
-
internalType: "struct Multicall3.Result[]",
|
|
102
|
-
name: "returnData",
|
|
103
|
-
type: "tuple[]"
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
|
-
stateMutability: "payable",
|
|
107
|
-
type: "function"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
inputs: [],
|
|
111
|
-
name: "getBasefee",
|
|
112
|
-
outputs: [{ internalType: "uint256", name: "basefee", type: "uint256" }],
|
|
113
|
-
stateMutability: "view",
|
|
114
|
-
type: "function"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
inputs: [{ internalType: "uint256", name: "blockNumber", type: "uint256" }],
|
|
118
|
-
name: "getBlockHash",
|
|
119
|
-
outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }],
|
|
120
|
-
stateMutability: "view",
|
|
121
|
-
type: "function"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
inputs: [],
|
|
125
|
-
name: "getBlockNumber",
|
|
126
|
-
outputs: [
|
|
127
|
-
{ internalType: "uint256", name: "blockNumber", type: "uint256" }
|
|
128
|
-
],
|
|
129
|
-
stateMutability: "view",
|
|
130
|
-
type: "function"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
inputs: [],
|
|
134
|
-
name: "getChainId",
|
|
135
|
-
outputs: [{ internalType: "uint256", name: "chainid", type: "uint256" }],
|
|
136
|
-
stateMutability: "view",
|
|
137
|
-
type: "function"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
inputs: [],
|
|
141
|
-
name: "getCurrentBlockCoinbase",
|
|
142
|
-
outputs: [{ internalType: "address", name: "coinbase", type: "address" }],
|
|
143
|
-
stateMutability: "view",
|
|
144
|
-
type: "function"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
inputs: [],
|
|
148
|
-
name: "getCurrentBlockDifficulty",
|
|
149
|
-
outputs: [{ internalType: "uint256", name: "difficulty", type: "uint256" }],
|
|
150
|
-
stateMutability: "view",
|
|
151
|
-
type: "function"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
inputs: [],
|
|
155
|
-
name: "getCurrentBlockGasLimit",
|
|
156
|
-
outputs: [{ internalType: "uint256", name: "gaslimit", type: "uint256" }],
|
|
157
|
-
stateMutability: "view",
|
|
158
|
-
type: "function"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
inputs: [],
|
|
162
|
-
name: "getCurrentBlockTimestamp",
|
|
163
|
-
outputs: [{ internalType: "uint256", name: "timestamp", type: "uint256" }],
|
|
164
|
-
stateMutability: "view",
|
|
165
|
-
type: "function"
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
inputs: [{ internalType: "address", name: "addr", type: "address" }],
|
|
169
|
-
name: "getEthBalance",
|
|
170
|
-
outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }],
|
|
171
|
-
stateMutability: "view",
|
|
172
|
-
type: "function"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
inputs: [],
|
|
176
|
-
name: "getLastBlockHash",
|
|
177
|
-
outputs: [{ internalType: "bytes32", name: "blockHash", type: "bytes32" }],
|
|
178
|
-
stateMutability: "view",
|
|
179
|
-
type: "function"
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
inputs: [
|
|
183
|
-
{ internalType: "bool", name: "requireSuccess", type: "bool" },
|
|
184
|
-
{
|
|
185
|
-
components: [
|
|
186
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
187
|
-
{ internalType: "bytes", name: "callData", type: "bytes" }
|
|
188
|
-
],
|
|
189
|
-
internalType: "struct Multicall3.Call[]",
|
|
190
|
-
name: "calls",
|
|
191
|
-
type: "tuple[]"
|
|
192
|
-
}
|
|
193
|
-
],
|
|
194
|
-
name: "tryAggregate",
|
|
195
|
-
outputs: [
|
|
196
|
-
{
|
|
197
|
-
components: [
|
|
198
|
-
{ internalType: "bool", name: "success", type: "bool" },
|
|
199
|
-
{ internalType: "bytes", name: "returnData", type: "bytes" }
|
|
200
|
-
],
|
|
201
|
-
internalType: "struct Multicall3.Result[]",
|
|
202
|
-
name: "returnData",
|
|
203
|
-
type: "tuple[]"
|
|
204
|
-
}
|
|
205
|
-
],
|
|
206
|
-
stateMutability: "payable",
|
|
207
|
-
type: "function"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
inputs: [
|
|
211
|
-
{ internalType: "bool", name: "requireSuccess", type: "bool" },
|
|
212
|
-
{
|
|
213
|
-
components: [
|
|
214
|
-
{ internalType: "address", name: "target", type: "address" },
|
|
215
|
-
{ internalType: "bytes", name: "callData", type: "bytes" }
|
|
216
|
-
],
|
|
217
|
-
internalType: "struct Multicall3.Call[]",
|
|
218
|
-
name: "calls",
|
|
219
|
-
type: "tuple[]"
|
|
220
|
-
}
|
|
221
|
-
],
|
|
222
|
-
name: "tryBlockAndAggregate",
|
|
223
|
-
outputs: [
|
|
224
|
-
{ internalType: "uint256", name: "blockNumber", type: "uint256" },
|
|
225
|
-
{ internalType: "bytes32", name: "blockHash", type: "bytes32" },
|
|
226
|
-
{
|
|
227
|
-
components: [
|
|
228
|
-
{ internalType: "bool", name: "success", type: "bool" },
|
|
229
|
-
{ internalType: "bytes", name: "returnData", type: "bytes" }
|
|
230
|
-
],
|
|
231
|
-
internalType: "struct Multicall3.Result[]",
|
|
232
|
-
name: "returnData",
|
|
233
|
-
type: "tuple[]"
|
|
234
|
-
}
|
|
235
|
-
],
|
|
236
|
-
stateMutability: "payable",
|
|
237
|
-
type: "function"
|
|
238
|
-
}
|
|
239
|
-
];
|
|
240
|
-
|
|
241
|
-
export {
|
|
242
|
-
multicall3Abi
|
|
243
|
-
};
|
|
244
|
-
//# sourceMappingURL=chunk-ZCEFC2TK.mjs.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GetGlobalData,
|
|
3
|
-
type GetGlobalDataQuery,
|
|
4
|
-
type GetGlobalDataQueryVariables,
|
|
5
|
-
} from "@berachain/graphql/honey";
|
|
6
|
-
|
|
7
|
-
import { getApolloClient } from "../clients/getApolloClient";
|
|
8
|
-
|
|
9
|
-
export async function getHoneyGlobalData({
|
|
10
|
-
...args
|
|
11
|
-
}: BeraJS.BaseFunctionArgs = {}) {
|
|
12
|
-
const client = getApolloClient("honey.subgraph", args);
|
|
13
|
-
const result = await client.query<
|
|
14
|
-
GetGlobalDataQuery,
|
|
15
|
-
GetGlobalDataQueryVariables
|
|
16
|
-
>({
|
|
17
|
-
query: GetGlobalData,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return result.data;
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
|
-
|
|
3
|
-
import BigNumber from "@berachain/utils/pkg/bignumber.js";
|
|
4
|
-
|
|
5
|
-
import { getHoneyGlobalData } from "../../actions/honey/getHoneyGlobalData";
|
|
6
|
-
|
|
7
|
-
export function useHoneyGlobalData() {
|
|
8
|
-
const response = useSWR(["useHoneyGlobalData"], () => getHoneyGlobalData());
|
|
9
|
-
|
|
10
|
-
const dailyVolume = response.data?.honeySnapshots.reduce(
|
|
11
|
-
(acc, curr) => new BigNumber(curr.totalVolume).plus(acc),
|
|
12
|
-
new BigNumber(0),
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
...response,
|
|
17
|
-
data: {
|
|
18
|
-
...response.data,
|
|
19
|
-
dailyVolume,
|
|
20
|
-
},
|
|
21
|
-
refresh: () => response.mutate(),
|
|
22
|
-
};
|
|
23
|
-
}
|