@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,571 @@
|
|
|
1
|
+
// src/abi/pyth/pyth.ts
|
|
2
|
+
var pythAbi = [
|
|
3
|
+
{
|
|
4
|
+
type: "function",
|
|
5
|
+
name: "getEmaPrice",
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
name: "id",
|
|
9
|
+
type: "bytes32",
|
|
10
|
+
internalType: "bytes32"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
outputs: [
|
|
14
|
+
{
|
|
15
|
+
name: "price",
|
|
16
|
+
type: "tuple",
|
|
17
|
+
internalType: "struct PythStructs.Price",
|
|
18
|
+
components: [
|
|
19
|
+
{
|
|
20
|
+
name: "price",
|
|
21
|
+
type: "int64",
|
|
22
|
+
internalType: "int64"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "conf",
|
|
26
|
+
type: "uint64",
|
|
27
|
+
internalType: "uint64"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "expo",
|
|
31
|
+
type: "int32",
|
|
32
|
+
internalType: "int32"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "publishTime",
|
|
36
|
+
type: "uint256",
|
|
37
|
+
internalType: "uint256"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
stateMutability: "view"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: "function",
|
|
46
|
+
name: "getEmaPriceNoOlderThan",
|
|
47
|
+
inputs: [
|
|
48
|
+
{
|
|
49
|
+
name: "id",
|
|
50
|
+
type: "bytes32",
|
|
51
|
+
internalType: "bytes32"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "age",
|
|
55
|
+
type: "uint256",
|
|
56
|
+
internalType: "uint256"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
outputs: [
|
|
60
|
+
{
|
|
61
|
+
name: "price",
|
|
62
|
+
type: "tuple",
|
|
63
|
+
internalType: "struct PythStructs.Price",
|
|
64
|
+
components: [
|
|
65
|
+
{
|
|
66
|
+
name: "price",
|
|
67
|
+
type: "int64",
|
|
68
|
+
internalType: "int64"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "conf",
|
|
72
|
+
type: "uint64",
|
|
73
|
+
internalType: "uint64"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "expo",
|
|
77
|
+
type: "int32",
|
|
78
|
+
internalType: "int32"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "publishTime",
|
|
82
|
+
type: "uint256",
|
|
83
|
+
internalType: "uint256"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
stateMutability: "view"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: "function",
|
|
92
|
+
name: "getEmaPriceUnsafe",
|
|
93
|
+
inputs: [
|
|
94
|
+
{
|
|
95
|
+
name: "id",
|
|
96
|
+
type: "bytes32",
|
|
97
|
+
internalType: "bytes32"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
outputs: [
|
|
101
|
+
{
|
|
102
|
+
name: "price",
|
|
103
|
+
type: "tuple",
|
|
104
|
+
internalType: "struct PythStructs.Price",
|
|
105
|
+
components: [
|
|
106
|
+
{
|
|
107
|
+
name: "price",
|
|
108
|
+
type: "int64",
|
|
109
|
+
internalType: "int64"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "conf",
|
|
113
|
+
type: "uint64",
|
|
114
|
+
internalType: "uint64"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "expo",
|
|
118
|
+
type: "int32",
|
|
119
|
+
internalType: "int32"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "publishTime",
|
|
123
|
+
type: "uint256",
|
|
124
|
+
internalType: "uint256"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
stateMutability: "view"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
type: "function",
|
|
133
|
+
name: "getPrice",
|
|
134
|
+
inputs: [
|
|
135
|
+
{
|
|
136
|
+
name: "id",
|
|
137
|
+
type: "bytes32",
|
|
138
|
+
internalType: "bytes32"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
outputs: [
|
|
142
|
+
{
|
|
143
|
+
name: "price",
|
|
144
|
+
type: "tuple",
|
|
145
|
+
internalType: "struct PythStructs.Price",
|
|
146
|
+
components: [
|
|
147
|
+
{
|
|
148
|
+
name: "price",
|
|
149
|
+
type: "int64",
|
|
150
|
+
internalType: "int64"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "conf",
|
|
154
|
+
type: "uint64",
|
|
155
|
+
internalType: "uint64"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "expo",
|
|
159
|
+
type: "int32",
|
|
160
|
+
internalType: "int32"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "publishTime",
|
|
164
|
+
type: "uint256",
|
|
165
|
+
internalType: "uint256"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
stateMutability: "view"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: "function",
|
|
174
|
+
name: "getPriceNoOlderThan",
|
|
175
|
+
inputs: [
|
|
176
|
+
{
|
|
177
|
+
name: "id",
|
|
178
|
+
type: "bytes32",
|
|
179
|
+
internalType: "bytes32"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: "age",
|
|
183
|
+
type: "uint256",
|
|
184
|
+
internalType: "uint256"
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
outputs: [
|
|
188
|
+
{
|
|
189
|
+
name: "price",
|
|
190
|
+
type: "tuple",
|
|
191
|
+
internalType: "struct PythStructs.Price",
|
|
192
|
+
components: [
|
|
193
|
+
{
|
|
194
|
+
name: "price",
|
|
195
|
+
type: "int64",
|
|
196
|
+
internalType: "int64"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "conf",
|
|
200
|
+
type: "uint64",
|
|
201
|
+
internalType: "uint64"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "expo",
|
|
205
|
+
type: "int32",
|
|
206
|
+
internalType: "int32"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "publishTime",
|
|
210
|
+
type: "uint256",
|
|
211
|
+
internalType: "uint256"
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
stateMutability: "view"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
type: "function",
|
|
220
|
+
name: "getPriceUnsafe",
|
|
221
|
+
inputs: [
|
|
222
|
+
{
|
|
223
|
+
name: "id",
|
|
224
|
+
type: "bytes32",
|
|
225
|
+
internalType: "bytes32"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
outputs: [
|
|
229
|
+
{
|
|
230
|
+
name: "price",
|
|
231
|
+
type: "tuple",
|
|
232
|
+
internalType: "struct PythStructs.Price",
|
|
233
|
+
components: [
|
|
234
|
+
{
|
|
235
|
+
name: "price",
|
|
236
|
+
type: "int64",
|
|
237
|
+
internalType: "int64"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "conf",
|
|
241
|
+
type: "uint64",
|
|
242
|
+
internalType: "uint64"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "expo",
|
|
246
|
+
type: "int32",
|
|
247
|
+
internalType: "int32"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "publishTime",
|
|
251
|
+
type: "uint256",
|
|
252
|
+
internalType: "uint256"
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
stateMutability: "view"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
type: "function",
|
|
261
|
+
name: "getUpdateFee",
|
|
262
|
+
inputs: [
|
|
263
|
+
{
|
|
264
|
+
name: "updateData",
|
|
265
|
+
type: "bytes[]",
|
|
266
|
+
internalType: "bytes[]"
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
outputs: [
|
|
270
|
+
{
|
|
271
|
+
name: "feeAmount",
|
|
272
|
+
type: "uint256",
|
|
273
|
+
internalType: "uint256"
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
stateMutability: "view"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
type: "function",
|
|
280
|
+
name: "getValidTimePeriod",
|
|
281
|
+
inputs: [],
|
|
282
|
+
outputs: [
|
|
283
|
+
{
|
|
284
|
+
name: "validTimePeriod",
|
|
285
|
+
type: "uint256",
|
|
286
|
+
internalType: "uint256"
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
stateMutability: "view"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
type: "function",
|
|
293
|
+
name: "parsePriceFeedUpdates",
|
|
294
|
+
inputs: [
|
|
295
|
+
{
|
|
296
|
+
name: "updateData",
|
|
297
|
+
type: "bytes[]",
|
|
298
|
+
internalType: "bytes[]"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "priceIds",
|
|
302
|
+
type: "bytes32[]",
|
|
303
|
+
internalType: "bytes32[]"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: "minPublishTime",
|
|
307
|
+
type: "uint64",
|
|
308
|
+
internalType: "uint64"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: "maxPublishTime",
|
|
312
|
+
type: "uint64",
|
|
313
|
+
internalType: "uint64"
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
outputs: [
|
|
317
|
+
{
|
|
318
|
+
name: "priceFeeds",
|
|
319
|
+
type: "tuple[]",
|
|
320
|
+
internalType: "struct PythStructs.PriceFeed[]",
|
|
321
|
+
components: [
|
|
322
|
+
{
|
|
323
|
+
name: "id",
|
|
324
|
+
type: "bytes32",
|
|
325
|
+
internalType: "bytes32"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: "price",
|
|
329
|
+
type: "tuple",
|
|
330
|
+
internalType: "struct PythStructs.Price",
|
|
331
|
+
components: [
|
|
332
|
+
{
|
|
333
|
+
name: "price",
|
|
334
|
+
type: "int64",
|
|
335
|
+
internalType: "int64"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: "conf",
|
|
339
|
+
type: "uint64",
|
|
340
|
+
internalType: "uint64"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "expo",
|
|
344
|
+
type: "int32",
|
|
345
|
+
internalType: "int32"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
name: "publishTime",
|
|
349
|
+
type: "uint256",
|
|
350
|
+
internalType: "uint256"
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: "emaPrice",
|
|
356
|
+
type: "tuple",
|
|
357
|
+
internalType: "struct PythStructs.Price",
|
|
358
|
+
components: [
|
|
359
|
+
{
|
|
360
|
+
name: "price",
|
|
361
|
+
type: "int64",
|
|
362
|
+
internalType: "int64"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
name: "conf",
|
|
366
|
+
type: "uint64",
|
|
367
|
+
internalType: "uint64"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
name: "expo",
|
|
371
|
+
type: "int32",
|
|
372
|
+
internalType: "int32"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: "publishTime",
|
|
376
|
+
type: "uint256",
|
|
377
|
+
internalType: "uint256"
|
|
378
|
+
}
|
|
379
|
+
]
|
|
380
|
+
}
|
|
381
|
+
]
|
|
382
|
+
}
|
|
383
|
+
],
|
|
384
|
+
stateMutability: "payable"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
type: "function",
|
|
388
|
+
name: "parsePriceFeedUpdatesUnique",
|
|
389
|
+
inputs: [
|
|
390
|
+
{
|
|
391
|
+
name: "updateData",
|
|
392
|
+
type: "bytes[]",
|
|
393
|
+
internalType: "bytes[]"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
name: "priceIds",
|
|
397
|
+
type: "bytes32[]",
|
|
398
|
+
internalType: "bytes32[]"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: "minPublishTime",
|
|
402
|
+
type: "uint64",
|
|
403
|
+
internalType: "uint64"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
name: "maxPublishTime",
|
|
407
|
+
type: "uint64",
|
|
408
|
+
internalType: "uint64"
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
outputs: [
|
|
412
|
+
{
|
|
413
|
+
name: "priceFeeds",
|
|
414
|
+
type: "tuple[]",
|
|
415
|
+
internalType: "struct PythStructs.PriceFeed[]",
|
|
416
|
+
components: [
|
|
417
|
+
{
|
|
418
|
+
name: "id",
|
|
419
|
+
type: "bytes32",
|
|
420
|
+
internalType: "bytes32"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
name: "price",
|
|
424
|
+
type: "tuple",
|
|
425
|
+
internalType: "struct PythStructs.Price",
|
|
426
|
+
components: [
|
|
427
|
+
{
|
|
428
|
+
name: "price",
|
|
429
|
+
type: "int64",
|
|
430
|
+
internalType: "int64"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
name: "conf",
|
|
434
|
+
type: "uint64",
|
|
435
|
+
internalType: "uint64"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
name: "expo",
|
|
439
|
+
type: "int32",
|
|
440
|
+
internalType: "int32"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: "publishTime",
|
|
444
|
+
type: "uint256",
|
|
445
|
+
internalType: "uint256"
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: "emaPrice",
|
|
451
|
+
type: "tuple",
|
|
452
|
+
internalType: "struct PythStructs.Price",
|
|
453
|
+
components: [
|
|
454
|
+
{
|
|
455
|
+
name: "price",
|
|
456
|
+
type: "int64",
|
|
457
|
+
internalType: "int64"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: "conf",
|
|
461
|
+
type: "uint64",
|
|
462
|
+
internalType: "uint64"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
name: "expo",
|
|
466
|
+
type: "int32",
|
|
467
|
+
internalType: "int32"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: "publishTime",
|
|
471
|
+
type: "uint256",
|
|
472
|
+
internalType: "uint256"
|
|
473
|
+
}
|
|
474
|
+
]
|
|
475
|
+
}
|
|
476
|
+
]
|
|
477
|
+
}
|
|
478
|
+
],
|
|
479
|
+
stateMutability: "payable"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
type: "function",
|
|
483
|
+
name: "updatePriceFeeds",
|
|
484
|
+
inputs: [
|
|
485
|
+
{
|
|
486
|
+
name: "updateData",
|
|
487
|
+
type: "bytes[]",
|
|
488
|
+
internalType: "bytes[]"
|
|
489
|
+
}
|
|
490
|
+
],
|
|
491
|
+
outputs: [],
|
|
492
|
+
stateMutability: "payable"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
type: "function",
|
|
496
|
+
name: "updatePriceFeedsIfNecessary",
|
|
497
|
+
inputs: [
|
|
498
|
+
{
|
|
499
|
+
name: "updateData",
|
|
500
|
+
type: "bytes[]",
|
|
501
|
+
internalType: "bytes[]"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: "priceIds",
|
|
505
|
+
type: "bytes32[]",
|
|
506
|
+
internalType: "bytes32[]"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
name: "publishTimes",
|
|
510
|
+
type: "uint64[]",
|
|
511
|
+
internalType: "uint64[]"
|
|
512
|
+
}
|
|
513
|
+
],
|
|
514
|
+
outputs: [],
|
|
515
|
+
stateMutability: "payable"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
type: "event",
|
|
519
|
+
name: "BatchPriceFeedUpdate",
|
|
520
|
+
inputs: [
|
|
521
|
+
{
|
|
522
|
+
name: "chainId",
|
|
523
|
+
type: "uint16",
|
|
524
|
+
indexed: false,
|
|
525
|
+
internalType: "uint16"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
name: "sequenceNumber",
|
|
529
|
+
type: "uint64",
|
|
530
|
+
indexed: false,
|
|
531
|
+
internalType: "uint64"
|
|
532
|
+
}
|
|
533
|
+
],
|
|
534
|
+
anonymous: false
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
type: "event",
|
|
538
|
+
name: "PriceFeedUpdate",
|
|
539
|
+
inputs: [
|
|
540
|
+
{
|
|
541
|
+
name: "id",
|
|
542
|
+
type: "bytes32",
|
|
543
|
+
indexed: true,
|
|
544
|
+
internalType: "bytes32"
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
name: "publishTime",
|
|
548
|
+
type: "uint64",
|
|
549
|
+
indexed: false,
|
|
550
|
+
internalType: "uint64"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
name: "price",
|
|
554
|
+
type: "int64",
|
|
555
|
+
indexed: false,
|
|
556
|
+
internalType: "int64"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
name: "conf",
|
|
560
|
+
type: "uint64",
|
|
561
|
+
indexed: false,
|
|
562
|
+
internalType: "uint64"
|
|
563
|
+
}
|
|
564
|
+
],
|
|
565
|
+
anonymous: false
|
|
566
|
+
}
|
|
567
|
+
];
|
|
568
|
+
|
|
569
|
+
export {
|
|
570
|
+
pythAbi
|
|
571
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// src/enum/governance.ts
|
|
2
|
+
var ProposalState = /* @__PURE__ */ ((ProposalState2) => {
|
|
3
|
+
ProposalState2[ProposalState2["Pending"] = 0] = "Pending";
|
|
4
|
+
ProposalState2[ProposalState2["Active"] = 1] = "Active";
|
|
5
|
+
ProposalState2[ProposalState2["Canceled"] = 2] = "Canceled";
|
|
6
|
+
ProposalState2[ProposalState2["Defeated"] = 3] = "Defeated";
|
|
7
|
+
ProposalState2[ProposalState2["Succeeded"] = 4] = "Succeeded";
|
|
8
|
+
ProposalState2[ProposalState2["Queued"] = 5] = "Queued";
|
|
9
|
+
ProposalState2[ProposalState2["Expired"] = 6] = "Expired";
|
|
10
|
+
ProposalState2[ProposalState2["Executed"] = 7] = "Executed";
|
|
11
|
+
return ProposalState2;
|
|
12
|
+
})(ProposalState || {});
|
|
13
|
+
var VoteEnum = /* @__PURE__ */ ((VoteEnum2) => {
|
|
14
|
+
VoteEnum2["AGAINST"] = "no";
|
|
15
|
+
VoteEnum2["FOR"] = "yes";
|
|
16
|
+
VoteEnum2["ABSTAIN"] = "abstain";
|
|
17
|
+
return VoteEnum2;
|
|
18
|
+
})(VoteEnum || {});
|
|
19
|
+
var ProposalErrorCodes = /* @__PURE__ */ ((ProposalErrorCodes2) => {
|
|
20
|
+
ProposalErrorCodes2["REQUIRED"] = "Required";
|
|
21
|
+
ProposalErrorCodes2["INVALID_AMOUNT"] = "Invalid amount";
|
|
22
|
+
ProposalErrorCodes2["NEGATIVE_AMOUNT"] = "Negative amount";
|
|
23
|
+
ProposalErrorCodes2["INVALID_ADDRESS"] = "Invalid address";
|
|
24
|
+
ProposalErrorCodes2["INVALID_ACTION"] = "Invalid action";
|
|
25
|
+
ProposalErrorCodes2["INVALID_ABI"] = "Invalid ABI";
|
|
26
|
+
ProposalErrorCodes2["MUST_BE_HTTPS"] = "Must be HTTPS";
|
|
27
|
+
ProposalErrorCodes2["MUST_BE_HTTPS_OR_IPFS"] = "Must be HTTPS or IPFS";
|
|
28
|
+
ProposalErrorCodes2["INVALID_BASEPATH"] = "Must be a berachain forum link";
|
|
29
|
+
ProposalErrorCodes2["INVALID_CONTRACT"] = "This is not a valid contract";
|
|
30
|
+
return ProposalErrorCodes2;
|
|
31
|
+
})(ProposalErrorCodes || {});
|
|
32
|
+
var ProposalTypeEnum = /* @__PURE__ */ ((ProposalTypeEnum2) => {
|
|
33
|
+
ProposalTypeEnum2["CUSTOM_PROPOSAL"] = "custom-action";
|
|
34
|
+
ProposalTypeEnum2["WHITELIST_REWARD_VAULT"] = "whitelist-reward-vault";
|
|
35
|
+
ProposalTypeEnum2["BLACKLIST_REWARD_VAULT"] = "blacklist-reward-vault";
|
|
36
|
+
ProposalTypeEnum2["ERC20_TRANSFER"] = "erc20-transfer";
|
|
37
|
+
ProposalTypeEnum2["WHITELIST_REWARD_VAULT_INCENTIVE"] = "whitelist-reward-vault-incentive";
|
|
38
|
+
return ProposalTypeEnum2;
|
|
39
|
+
})(ProposalTypeEnum || {});
|
|
40
|
+
var VoteColorMap = {
|
|
41
|
+
yes: "#059669",
|
|
42
|
+
1: "#059669",
|
|
43
|
+
no: "#DC2629",
|
|
44
|
+
2: "#DC2629",
|
|
45
|
+
veto: "#0284C7",
|
|
46
|
+
4: "#0284C7",
|
|
47
|
+
abstain: "#78716c",
|
|
48
|
+
3: "#78716c",
|
|
49
|
+
yes_secondary: "#ECFDF5",
|
|
50
|
+
no_secondary: "#FEF2F2",
|
|
51
|
+
veto_secondary: "#F0F9FF",
|
|
52
|
+
abstain_secondary: "#E7E5E4",
|
|
53
|
+
default: "#57534e"
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
ProposalState,
|
|
58
|
+
VoteEnum,
|
|
59
|
+
ProposalErrorCodes,
|
|
60
|
+
ProposalTypeEnum,
|
|
61
|
+
VoteColorMap
|
|
62
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RequestError
|
|
3
|
+
} from "./chunk-XIYN6AL6.mjs";
|
|
4
|
+
import {
|
|
5
|
+
BeraError,
|
|
6
|
+
parseViemError
|
|
7
|
+
} from "./chunk-J5I45WGQ.mjs";
|
|
8
|
+
|
|
9
|
+
// src/errors/initBeraError.ts
|
|
10
|
+
import { BaseError } from "viem";
|
|
11
|
+
function initBeraError({
|
|
12
|
+
cause: error,
|
|
13
|
+
level
|
|
14
|
+
}) {
|
|
15
|
+
if (error instanceof BaseError) {
|
|
16
|
+
const parsed = parseViemError({
|
|
17
|
+
error,
|
|
18
|
+
revertIfUnknown: false
|
|
19
|
+
});
|
|
20
|
+
if (parsed.isRequestError && parsed.rootCause instanceof BaseError && "url" in parsed.rootCause && typeof parsed.rootCause.url === "string") {
|
|
21
|
+
return new RequestError({
|
|
22
|
+
cause: parsed.rootCause,
|
|
23
|
+
response: void 0,
|
|
24
|
+
endpoint: {
|
|
25
|
+
url: parsed.rootCause.url,
|
|
26
|
+
type: "rpc"
|
|
27
|
+
},
|
|
28
|
+
level
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const err = error instanceof BeraError ? error : new BeraError({
|
|
33
|
+
cause: error,
|
|
34
|
+
level
|
|
35
|
+
});
|
|
36
|
+
return err;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/utils/createEmitter.ts
|
|
40
|
+
function createEmitter() {
|
|
41
|
+
const events = {};
|
|
42
|
+
return {
|
|
43
|
+
emit(event, ...args) {
|
|
44
|
+
for (const callback of events[event] || []) {
|
|
45
|
+
callback(...args);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
events,
|
|
49
|
+
on(event, cb) {
|
|
50
|
+
if (!events[event]) {
|
|
51
|
+
events[event] = [];
|
|
52
|
+
}
|
|
53
|
+
events[event].push(cb);
|
|
54
|
+
return () => {
|
|
55
|
+
events[event] = events[event]?.filter((i) => cb !== i);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/errors/BeraMonitoring.ts
|
|
62
|
+
var _emitter = createEmitter();
|
|
63
|
+
var BeraMonitoring = {
|
|
64
|
+
/**
|
|
65
|
+
* Capture an exception. Notifies all subscribers.
|
|
66
|
+
*/
|
|
67
|
+
captureException(exception) {
|
|
68
|
+
const event = {
|
|
69
|
+
exception,
|
|
70
|
+
timestamp: Date.now()
|
|
71
|
+
};
|
|
72
|
+
_emitter.emit("exception", event);
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* Subscribe to error events.
|
|
76
|
+
* @returns An unsubscribe function.
|
|
77
|
+
*/
|
|
78
|
+
on(...args) {
|
|
79
|
+
return _emitter.on(...args);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
initBeraError,
|
|
85
|
+
BeraMonitoring
|
|
86
|
+
};
|