@berachain/berajs 0.2.8-beta.8 → 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.
Files changed (225) hide show
  1. package/dist/{BeraError-_mQdkanr.d.cts → BeraError-7-A5JYy_.d.ts} +31 -2
  2. package/dist/{HoneyConfigProvider-DVP_9KZn.d.ts → HoneyConfigProvider-Dkj-_a5x.d.ts} +1 -1
  3. package/dist/RequestError-DBOIV65x.d.ts +144 -0
  4. package/dist/abi/exports.mjs +3 -4
  5. package/dist/actions/clients/exports.d.ts +2 -0
  6. package/dist/actions/clients/exports.mjs +12 -0
  7. package/dist/actions/exports.d.ts +108 -187
  8. package/dist/actions/exports.mjs +97 -158
  9. package/dist/actions/governance/exports.d.ts +140 -0
  10. package/dist/actions/governance/exports.mjs +226 -0
  11. package/dist/actions/server/exports.d.ts +13 -0
  12. package/dist/actions/server/exports.mjs +27 -0
  13. package/dist/{chunk-VA3BQ34H.mjs → chunk-3EARVV7K.mjs} +20 -9
  14. package/dist/chunk-4Z4AK6SH.mjs +211 -0
  15. package/dist/chunk-75M6TF7M.mjs +25 -0
  16. package/dist/chunk-AFN4CVD3.mjs +326 -0
  17. package/dist/{chunk-7TFV6UKF.mjs → chunk-BGMRHTBQ.mjs} +0 -1
  18. package/dist/{chunk-3M47ZRXT.mjs → chunk-CDFWPU2R.mjs} +73 -17
  19. package/dist/{chunk-GWSTVITN.mjs → chunk-CDK4YV3D.mjs} +0 -1
  20. package/dist/{chunk-KL6YZ5VR.mjs → chunk-DKMAIU74.mjs} +0 -1
  21. package/dist/chunk-EXIUPSFN.mjs +86 -0
  22. package/dist/{chunk-VA5L5FDG.mjs → chunk-FFB5LFDW.mjs} +2 -3
  23. package/dist/{chunk-ZCEFC2TK.mjs → chunk-HQCOU6GY.mjs} +0 -1
  24. package/dist/{chunk-SGZP4O6R.mjs → chunk-HSSJKHZ4.mjs} +11 -11
  25. package/dist/{chunk-7QKRRIHI.mjs → chunk-J5I45WGQ.mjs} +77 -152
  26. package/dist/chunk-KQUMKB66.mjs +89 -0
  27. package/dist/{chunk-JA4DHMTG.mjs → chunk-NBYLMO2L.mjs} +0 -1
  28. package/dist/{chunk-4GFN4LEP.mjs → chunk-NPBQLVL3.mjs} +4 -21
  29. package/dist/{chunk-I3FTWD6I.mjs → chunk-O2NQFKJK.mjs} +1 -1
  30. package/dist/{chunk-2R73G2PO.mjs → chunk-QJIXTYTZ.mjs} +121 -765
  31. package/dist/{chunk-GLWPRM33.mjs → chunk-SGIJVHZO.mjs} +0 -1
  32. package/dist/chunk-SZ5C44L5.mjs +35 -0
  33. package/dist/{chunk-5NMATIH4.mjs → chunk-WXXOISTU.mjs} +1 -35
  34. package/dist/chunk-XIYN6AL6.mjs +160 -0
  35. package/dist/contexts/exports.d.ts +2 -2
  36. package/dist/contexts/exports.mjs +11 -9
  37. package/dist/enum/exports.d.ts +1 -1
  38. package/dist/enum/exports.mjs +3 -16
  39. package/dist/enum/governance/exports.d.ts +60 -0
  40. package/dist/enum/governance/exports.mjs +14 -0
  41. package/dist/errors/exports.d.ts +5 -90
  42. package/dist/errors/exports.mjs +19 -10
  43. package/dist/exports-BcUTGFUb.d.ts +40 -0
  44. package/dist/{getValidatorQueuedOperatorAddress-BcyxE9uw.d.ts → getValidatorQueuedOperatorAddress-Dw5KN5sh.d.ts} +2 -2
  45. package/dist/{global.d-5w_lvl2J.d.ts → global.d-BuGDKh4k.d.ts} +4 -240
  46. package/dist/hooks/exports.d.ts +80 -236
  47. package/dist/hooks/exports.mjs +609 -1508
  48. package/dist/hooks/governance/exports.d.ts +181 -0
  49. package/dist/hooks/governance/exports.mjs +888 -0
  50. package/dist/pol.d-CqPA9K6m.d.ts +142 -0
  51. package/dist/{txnEnum-7_o92X3N.d.cts → txnEnum-ByI5dtDi.d.ts} +2 -60
  52. package/dist/types/exports.d.ts +9 -9
  53. package/dist/types/exports.mjs +0 -1
  54. package/dist/types/governance/exports.d.ts +109 -0
  55. package/dist/types/governance/exports.mjs +0 -0
  56. package/dist/{useHoneySwapState-B494PQDl.d.ts → useHoneySwapState-vFmuFF0g.d.ts} +1 -1
  57. package/dist/utils/exports.d.ts +24 -7
  58. package/dist/utils/exports.mjs +49 -11
  59. package/package.json +60 -13
  60. package/src/actions/__test/transports.ts +61 -0
  61. package/src/actions/clients/BeraApolloClient.ts +9 -0
  62. package/src/actions/clients/exports.ts +4 -0
  63. package/src/actions/clients/getApolloClient.ts +70 -25
  64. package/src/actions/clients/getEnsoClient.ts +20 -9
  65. package/src/actions/dex/aggregators/base.ts +1 -1
  66. package/src/actions/dex/aggregators/enso/enso.ts +27 -17
  67. package/src/actions/dex/aggregators/enso/ensoErc4626.ts +2 -2
  68. package/src/actions/dex/aggregators/kyberswap.ts +18 -23
  69. package/src/actions/enso/__tests__/getEnsoUserTokensWithBalances.debug.test.ts +3 -6
  70. package/src/actions/exports.ts +5 -10
  71. package/src/actions/governance/exports.ts +9 -0
  72. package/src/actions/governance/getAllProposals.ts +10 -65
  73. package/src/actions/governance/getProposalDetails.ts +6 -33
  74. package/src/actions/governance/getProposalVotes.ts +8 -15
  75. package/src/actions/honey/getChartData.ts +27 -21
  76. package/src/actions/honey/getHoney24hVolume.ts +27 -0
  77. package/src/actions/pol/getAutoclaimedIncentives.ts +30 -0
  78. package/src/actions/pol/getBeraTokenTotalSupply.ts +45 -0
  79. package/src/actions/pol/getBgtIncentiveDistributorPaused.ts +35 -0
  80. package/src/actions/pol/getEarnedStakedBeraVault.ts +15 -9
  81. package/src/actions/pol/getGlobalData.ts +1 -0
  82. package/src/actions/pol/getHeroEarnVaults.ts +62 -0
  83. package/src/actions/pol/getIncentiveFeeClaimStats.ts +19 -38
  84. package/src/actions/pol/getSWBeraVaultMetadata.ts +1 -1
  85. package/src/actions/pol/getStakingDailyAssets.ts +11 -8
  86. package/src/actions/server/exports.ts +1 -0
  87. package/src/actions/server/getDailyValidatorBlockStats.ts +33 -0
  88. package/src/actions/tokens/getWalletBalances.integration.test.ts +3 -6
  89. package/src/actions/transactions/beraWriteContract.integration.test.ts +3 -6
  90. package/src/actions/validators/getDailyValidatorBlockStats.ts +25 -24
  91. package/src/actions/validators/getValidatorAnalytics.ts +20 -21
  92. package/src/actions/validators/getValidatorIncentiveDistribution.ts +33 -0
  93. package/src/data/contracts.ts +5 -0
  94. package/src/enum/contracts.ts +1 -0
  95. package/src/enum/exports.ts +0 -1
  96. package/src/enum/governance/exports.ts +1 -0
  97. package/src/errors/BeraError.ts +47 -7
  98. package/src/errors/BeraTracing.unit.test.ts +65 -0
  99. package/src/errors/RequestError.ts +15 -2
  100. package/src/errors/exports.ts +5 -0
  101. package/src/errors/getRevertReason.integration.test.ts +3 -3
  102. package/src/errors/spanStatus.ts +78 -0
  103. package/src/errors/spanStatus.unit.test.ts +62 -0
  104. package/src/hooks/dex/useCreatePool.ts +1 -88
  105. package/src/hooks/dex/useOnChainPoolData.ts +27 -2
  106. package/src/hooks/dex/usePriceImpact.ts +12 -5
  107. package/src/hooks/enso/useBendDemultiply.ts +9 -1
  108. package/src/hooks/enso/useBendMultiply.ts +9 -1
  109. package/src/hooks/enso/useBendZapSupply.ts +26 -7
  110. package/src/hooks/enso/useEnsoSwapBundle.ts +17 -3
  111. package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +13 -2
  112. package/src/hooks/exports.ts +3 -16
  113. package/src/hooks/governance/exports.ts +14 -0
  114. package/src/hooks/honey/useHoney24hVolume.ts +16 -0
  115. package/src/hooks/pol/useAutoclaimedIncentives.ts +49 -0
  116. package/src/hooks/pol/useStakedAPR.ts +2 -2
  117. package/src/hooks/pol/useStakedSnapshots.ts +5 -9
  118. package/src/hooks/validators/useValidator.ts +2 -0
  119. package/src/hooks/validators/useValidatorIncentiveDistribution.ts +39 -0
  120. package/src/types/bribe-boost.d.ts +8 -0
  121. package/src/types/exports.ts +0 -1
  122. package/src/types/governance/exports.ts +1 -0
  123. package/src/utils/beraFetch.ts +76 -15
  124. package/src/utils/exports.ts +1 -0
  125. package/src/utils/getServerSideClient.ts +4 -2
  126. package/src/utils/sanitizeRpcUrl.ts +22 -0
  127. package/src/utils/tracedTransport.ts +35 -0
  128. package/dist/BeraError-_mQdkanr.d.ts +0 -94
  129. package/dist/BexStatusProvider-DRymVlQf.d.cts +0 -70
  130. package/dist/HoneyConfigProvider-DfkjmzEf.d.cts +0 -390
  131. package/dist/RequestError-A8XJ6QR9.d.cts +0 -57
  132. package/dist/RequestError-Dk97z8rm.d.ts +0 -57
  133. package/dist/abi/exports.cjs +0 -4453
  134. package/dist/abi/exports.cjs.map +0 -1
  135. package/dist/abi/exports.d.cts +0 -6574
  136. package/dist/abi/exports.mjs.map +0 -1
  137. package/dist/actions/exports.cjs +0 -914
  138. package/dist/actions/exports.cjs.map +0 -1
  139. package/dist/actions/exports.d.cts +0 -1644
  140. package/dist/actions/exports.mjs.map +0 -1
  141. package/dist/chunk-2R73G2PO.mjs.map +0 -1
  142. package/dist/chunk-3M47ZRXT.mjs.map +0 -1
  143. package/dist/chunk-4GFN4LEP.mjs.map +0 -1
  144. package/dist/chunk-5N7QQS55.cjs +0 -130
  145. package/dist/chunk-5N7QQS55.cjs.map +0 -1
  146. package/dist/chunk-5NMATIH4.mjs.map +0 -1
  147. package/dist/chunk-7QKRRIHI.mjs.map +0 -1
  148. package/dist/chunk-7TFV6UKF.mjs.map +0 -1
  149. package/dist/chunk-A4FPM7U3.cjs +0 -63
  150. package/dist/chunk-A4FPM7U3.cjs.map +0 -1
  151. package/dist/chunk-BDHINMWQ.cjs +0 -417
  152. package/dist/chunk-BDHINMWQ.cjs.map +0 -1
  153. package/dist/chunk-BEHP54S3.cjs +0 -24
  154. package/dist/chunk-BEHP54S3.cjs.map +0 -1
  155. package/dist/chunk-EGDXV2PT.cjs +0 -36
  156. package/dist/chunk-EGDXV2PT.cjs.map +0 -1
  157. package/dist/chunk-EWBKSMPG.cjs +0 -13
  158. package/dist/chunk-EWBKSMPG.cjs.map +0 -1
  159. package/dist/chunk-F6ZW7ZDD.cjs +0 -403
  160. package/dist/chunk-F6ZW7ZDD.cjs.map +0 -1
  161. package/dist/chunk-FTXTRUYT.cjs +0 -170
  162. package/dist/chunk-FTXTRUYT.cjs.map +0 -1
  163. package/dist/chunk-GLWPRM33.mjs.map +0 -1
  164. package/dist/chunk-GWSTVITN.mjs.map +0 -1
  165. package/dist/chunk-H3Z37RYU.cjs +0 -15
  166. package/dist/chunk-H3Z37RYU.cjs.map +0 -1
  167. package/dist/chunk-I3FTWD6I.mjs.map +0 -1
  168. package/dist/chunk-JA4DHMTG.mjs.map +0 -1
  169. package/dist/chunk-KL6YZ5VR.mjs.map +0 -1
  170. package/dist/chunk-MXWPP6MS.cjs +0 -572
  171. package/dist/chunk-MXWPP6MS.cjs.map +0 -1
  172. package/dist/chunk-SGZP4O6R.mjs.map +0 -1
  173. package/dist/chunk-TDW5SPXR.cjs +0 -244
  174. package/dist/chunk-TDW5SPXR.cjs.map +0 -1
  175. package/dist/chunk-TGK3IXDN.cjs +0 -169
  176. package/dist/chunk-TGK3IXDN.cjs.map +0 -1
  177. package/dist/chunk-TJEW6YCJ.cjs +0 -97
  178. package/dist/chunk-TJEW6YCJ.cjs.map +0 -1
  179. package/dist/chunk-VA3BQ34H.mjs.map +0 -1
  180. package/dist/chunk-VA5L5FDG.mjs.map +0 -1
  181. package/dist/chunk-XSGCRLSD.cjs +0 -1844
  182. package/dist/chunk-XSGCRLSD.cjs.map +0 -1
  183. package/dist/chunk-XV3GG3HC.cjs +0 -135
  184. package/dist/chunk-XV3GG3HC.cjs.map +0 -1
  185. package/dist/chunk-Y5B224UX.cjs +0 -4698
  186. package/dist/chunk-Y5B224UX.cjs.map +0 -1
  187. package/dist/chunk-ZBTRKBSI.mjs +0 -169
  188. package/dist/chunk-ZBTRKBSI.mjs.map +0 -1
  189. package/dist/chunk-ZCEFC2TK.mjs.map +0 -1
  190. package/dist/contexts/exports.cjs +0 -83
  191. package/dist/contexts/exports.cjs.map +0 -1
  192. package/dist/contexts/exports.d.cts +0 -66
  193. package/dist/contexts/exports.mjs.map +0 -1
  194. package/dist/defaultFlags-D6KfkTZx.d.cts +0 -10
  195. package/dist/dex-C_BB0b0O.d.cts +0 -37
  196. package/dist/enum/exports.cjs +0 -59
  197. package/dist/enum/exports.cjs.map +0 -1
  198. package/dist/enum/exports.d.cts +0 -23
  199. package/dist/enum/exports.mjs.map +0 -1
  200. package/dist/errors/exports.cjs +0 -39
  201. package/dist/errors/exports.cjs.map +0 -1
  202. package/dist/errors/exports.d.cts +0 -413
  203. package/dist/errors/exports.mjs.map +0 -1
  204. package/dist/getValidatorQueuedOperatorAddress-Cql_D50j.d.cts +0 -562
  205. package/dist/global.d-B7IeayVX.d.cts +0 -474
  206. package/dist/honey-CYm0RWf4.d.cts +0 -14
  207. package/dist/hooks/exports.cjs +0 -8333
  208. package/dist/hooks/exports.cjs.map +0 -1
  209. package/dist/hooks/exports.d.cts +0 -1748
  210. package/dist/hooks/exports.mjs.map +0 -1
  211. package/dist/polling-BKnyavLI.d.cts +0 -8
  212. package/dist/txnEnum-7_o92X3N.d.ts +0 -164
  213. package/dist/types/exports.cjs +0 -1
  214. package/dist/types/exports.cjs.map +0 -1
  215. package/dist/types/exports.d.cts +0 -90
  216. package/dist/types/exports.mjs.map +0 -1
  217. package/dist/useHoneySwapState-D6vpv19r.d.cts +0 -32
  218. package/dist/utils/exports.cjs +0 -787
  219. package/dist/utils/exports.cjs.map +0 -1
  220. package/dist/utils/exports.d.cts +0 -412
  221. package/dist/utils/exports.mjs.map +0 -1
  222. package/src/actions/dex/getIsTokenExploited.ts +0 -63
  223. package/src/actions/honey/getHoneyGlobalData.ts +0 -21
  224. package/src/hooks/dex/useExploitedTokens.ts +0 -57
  225. package/src/hooks/honey/useHoneyGlobalData.ts +0 -23
@@ -1,474 +0,0 @@
1
- import { Address, Hex, AbiFunction, Abi, ContractFunctionName, ContractFunctionArgs, TransactionReceipt, WalletCallReceipt, Account } from 'viem';
2
- import { ProposalWithVotesFragment, ProposalVoteFragment } from '@berachain/graphql/governance';
3
- import { b as ProposalTypeEnum, P as ProposalErrorCodes, T as TransactionActionType, C as ContractName } from './txnEnum-7_o92X3N.cjs';
4
- import { a as TokenWithMetadata, b as Token } from './HoneyConfigProvider-DfkjmzEf.cjs';
5
- import { ApiValidatorFragment } from '@berachain/graphql/pol/api';
6
- import { Config, GetWalletClientReturnType } from '@wagmi/core';
7
- import { SWRResponse, SWRConfiguration } from 'swr';
8
- import { ChainId, BeraConfig } from '@berachain/config';
9
- import { B as BeraError } from './BeraError-_mQdkanr.cjs';
10
-
11
- type Proposal = ProposalWithVotesFragment;
12
-
13
- type Vote = ProposalVoteFragment;
14
-
15
- type Voter = Address;
16
-
17
- type ProposalVotes = {
18
- yes: number;
19
- no: number;
20
- abstain: number;
21
- };
22
-
23
- type PROPOSAL_GENRE = "berahub" | "honey" | "bend" | "berps" | "general";
24
-
25
- type CustomProposalActionErrors = {
26
- type?: null | ProposalErrorCodes;
27
- target?: null | ProposalErrorCodes;
28
- value?: null | ProposalErrorCodes;
29
- ABI?: null | ProposalErrorCodes;
30
- functionSignature?: null | ProposalErrorCodes;
31
- args?: (null | ProposalErrorCodes)[];
32
- vault?: null | ProposalErrorCodes;
33
- isFriend?: null | ProposalErrorCodes;
34
- to?: null | ProposalErrorCodes;
35
- amount?: null | ProposalErrorCodes;
36
- minIncentiveRate?: null | ProposalErrorCodes;
37
- managerAddress?: null | ProposalErrorCodes;
38
- input?: null | ProposalErrorCodes;
39
- token?: null | ProposalErrorCodes;
40
- rawCalldata?: null | ProposalErrorCodes;
41
- message?: null | ProposalErrorCodes;
42
- } | null;
43
-
44
- type CustomProposalErrors = {
45
- title?: null | ProposalErrorCodes;
46
- description?: null | ProposalErrorCodes;
47
- forumLink?: null | ProposalErrorCodes;
48
- actions?: CustomProposalActionErrors[];
49
- };
50
-
51
- type GovernanceTopic = {
52
- id: PROPOSAL_GENRE;
53
- color: string;
54
- icon: React.ReactNode;
55
- iconBackground?: string;
56
- name: string;
57
- slug: string;
58
- forumLink: string;
59
- description?: string;
60
- comingSoon?: boolean;
61
- };
62
- type CustomProposal = {
63
- title: string;
64
- description: any;
65
- actions: ProposalAction[];
66
- forumLink: string;
67
- topic: Set<PROPOSAL_GENRE>;
68
- };
69
-
70
- type SafeProposalAction = {
71
- value: bigint;
72
- target: "" | Address;
73
- } & (
74
- | {
75
- type: ProposalTypeEnum.CUSTOM_PROPOSAL;
76
- input: "ABI" | "rawCalldata" | "message";
77
- ABI: string;
78
- _isVerifiedAbi?: boolean;
79
- functionSignature: string;
80
- args: string[];
81
- rawCalldata: Hex;
82
- message: string;
83
- }
84
- | {
85
- type:
86
- | ProposalTypeEnum.WHITELIST_REWARD_VAULT
87
- | ProposalTypeEnum.BLACKLIST_REWARD_VAULT;
88
- vault: Address;
89
- }
90
- | {
91
- type: ProposalTypeEnum.ERC20_TRANSFER;
92
- to: Address;
93
- amount: string;
94
- }
95
- | {
96
- type: ProposalTypeEnum.WHITELIST_REWARD_VAULT_INCENTIVE;
97
- vault: Address;
98
- token: Address;
99
- minIncentiveRate: string;
100
- managerAddress: Address;
101
- }
102
- );
103
-
104
- type ProposalAction = Partial<SafeProposalAction> & {
105
- type: SafeProposalAction["type"];
106
- };
107
-
108
- type VerifiedAbi = {
109
- abiItem?: AbiFunction;
110
- functionName?: string;
111
- args: readonly unknown[];
112
- functionSignature?: string;
113
- };
114
-
115
- interface ProtocolMetadata {
116
- name: string;
117
- logoURI: string;
118
- url: string;
119
- description: string;
120
- tags?: string[];
121
- }
122
-
123
- /**
124
- * Configuration for a single staking option.
125
- * Maps receipt tokens to their accepted input tokens.
126
- */
127
- type StakingConfig = {
128
- /** Unique identifier for this staking config */
129
- id: string;
130
- /** The token received when staking (e.g., sWBERA, siBERA) */
131
- receiptToken: TokenWithMetadata;
132
- /** Tokens that can be staked to receive the receipt token */
133
- inputTokens: TokenWithMetadata[];
134
- };
135
-
136
- interface BribeBoostReward {
137
- token: string;
138
- total_unclaimed: string;
139
- }
140
-
141
- interface BribeBoostRewardItem {
142
- rewards: BribeBoostReward[];
143
- validator: string;
144
- }
145
-
146
- interface BribeBoostRewardProof {
147
- validator?: string;
148
- pagination: {
149
- next: number;
150
- previous: number;
151
- record_per_page: number;
152
- current_page: number;
153
- total_page: number;
154
- };
155
- rewards:
156
- | {
157
- id: string;
158
- dist_id: string;
159
- token: Address;
160
- recipient: string;
161
- amount: string;
162
- merkle_proof: string[];
163
- available_at: number;
164
- }[]
165
- | null;
166
- }
167
-
168
- interface BribeBoostValidatorApr {
169
- id: string;
170
- boost_total_bgt: string;
171
- rewards_total_usd: string;
172
- daily_rate: string;
173
- apr: string;
174
- apy: string;
175
- tokens: Address[]; // Confirm this type with backend real data
176
- validator: string;
177
- start_block: number;
178
- end_block: number;
179
- start_timestamp: number;
180
- end_timestamp: number;
181
- created_at: string;
182
- updated_at: string;
183
- }
184
-
185
- type IncentiveReward = {
186
- tokenMetadata: Token | undefined;
187
- tokenPrice: number;
188
- tokenValue: number;
189
- id: string;
190
- dist_id: string;
191
- token: string;
192
- recipient: string;
193
- formattedAmount: string;
194
- amount: string;
195
- merkle_proof: string[];
196
- available_at: number;
197
- };
198
- interface IncentiveRewardChunksWithValidatorData {
199
- validator: ApiValidatorInListFragment | ApiValidatorFragment | undefined;
200
- maxTimestamp: number | undefined;
201
- minTimestamp: number | undefined;
202
- totalValue: number;
203
- tokenTotals: {
204
- chainId: number;
205
- address: Address;
206
- amount: number;
207
- value: number;
208
- metadata: Token | undefined;
209
- }[];
210
- rewards: IncentiveReward[];
211
- isCurrent: boolean;
212
- }
213
-
214
- interface AggregatedTokenTotals {
215
- address: Address;
216
- amount: number;
217
- value: number;
218
- metadata: Token | undefined;
219
- chainId: number;
220
- }
221
-
222
- type ClaimedIncentives = Record<string, string>;
223
-
224
- type ClaimedIncentivesLocalState = Record<string, ClaimedIncentives>;
225
-
226
- interface UserVaultInfo {
227
- balance: bigint;
228
- delegatedBalance: bigint;
229
- withdrawableBalance: bigint;
230
- rewards: string;
231
- percentage: string;
232
- }
233
-
234
- type StakedBeraAsset = {
235
- token: TokenWithMetadata;
236
- apr: number;
237
- stakedAmount: number;
238
- stakedAmountUsd: number;
239
- earnedAmount: number;
240
- earnedAmountUsd: number;
241
- isLoadingEarnings?: boolean;
242
- };
243
-
244
- interface UseContractWriteApi {
245
- isLoading: boolean;
246
- isSubmitting: boolean;
247
- isSuccess: boolean;
248
- isError: boolean;
249
- write: IContractWriteFn;
250
- reset: () => void;
251
- }
252
- type PropagatedArgs<args> = Omit<args, TxnEventKeys | "contractName"> & {
253
- contractName?: string;
254
- };
255
- type TxnEventKeys = "onSuccess" | "onError" | "onLoading" | "onSubmission" | "onWarning";
256
- interface IUseContractWriteArgs<abi extends Abi | undefined = undefined, functionName extends abi extends Abi ? ContractFunctionName<abi> : never = abi extends Abi ? ContractFunctionName<abi> : never, params extends abi extends Abi ? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName> : never = abi extends Abi ? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName> : never> {
257
- onSuccess?: (receipts: TransactionReceipt | WalletCallReceipt<bigint, "success" | "reverted">,
258
- /**
259
- * Arguments that were used to call the write function.
260
- */
261
- writeArgs: PropagatedArgs<IContractWrite<abi, functionName, params>>) => void;
262
- onError?: (e: BeraError,
263
- /**
264
- * Arguments that were used to call the write function.
265
- */
266
- writeArgs: PropagatedArgs<IContractWrite<abi, functionName, params>>) => void;
267
- onLoading?: (
268
- /**
269
- * Arguments that were used to call the write function.
270
- */
271
- writeArgs: PropagatedArgs<IContractWrite<abi, functionName, params>>) => void;
272
- onSubmission?: (
273
- /**
274
- * @param args.id If request is a batch call, this will be the id of the request to the wallet provider
275
- * @param args.txHash If request is a single transaction, this will be the hash of the transaction to wait for
276
- */
277
- args: {
278
- txHash: Hex;
279
- id?: never;
280
- } | {
281
- id: string;
282
- txHash?: never;
283
- },
284
- /**
285
- * Arguments that were used to call the write function.
286
- */
287
- writeArgs: PropagatedArgs<IContractWrite<abi, functionName, params>>) => void;
288
- /**
289
- * Callback function executed when a transaction encounters a warning. Transaction will still be submitted.
290
- */
291
- onWarning?: (e: BeraError, writeArgs: Omit<IContractWrite<abi, functionName, params>, TxnEventKeys>) => void;
292
- }
293
-
294
- type DefaultHookOptions = {
295
- opts?: SWRConfiguration & { isEnabled?: boolean };
296
- };
297
-
298
- type DefaultHookReturnType<T = any> = Omit<
299
- SWRResponse<T, any, any>,
300
- "mutate"
301
- > & {
302
- refresh: () => void;
303
- };
304
-
305
- type IContractWriteFn = <
306
- abi extends Abi | undefined = undefined,
307
- functionName extends abi extends Abi
308
- ? ContractFunctionName<abi>
309
- : never = abi extends Abi ? ContractFunctionName<abi> : never,
310
- params extends abi extends Abi
311
- ? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName>
312
- : never = abi extends Abi
313
- ? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName>
314
- : never,
315
- >(
316
- props: IContractWrite<abi, functionName, params>,
317
- ) => Promise<
318
- | TransactionReceipt
319
- | WalletCallReceipt<bigint, "success" | "reverted">
320
- | undefined
321
- >;
322
-
323
- /**
324
- * Posthog must be able to serialize this. BigInts are not supported.
325
- */
326
- type AllowedEventData = number | string | boolean | null | undefined;
327
-
328
- type EventData = Record<
329
- string,
330
- | AllowedEventData
331
- | AllowedEventData[]
332
- | Record<
333
- string,
334
- | AllowedEventData
335
- | AllowedEventData[]
336
- | Record<string, AllowedEventData | AllowedEventData[]>
337
- >
338
- >;
339
-
340
- type IContractWrite<
341
- abi extends Abi | undefined = undefined,
342
- functionName extends abi extends Abi
343
- ? ContractFunctionName<abi>
344
- : never = abi extends Abi ? ContractFunctionName<abi> : never,
345
- params extends abi extends Abi
346
- ? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName>
347
- : never = abi extends Abi
348
- ? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName>
349
- : never,
350
- > = {
351
- /**
352
- * A message that will be shown to user while the transaction is pending.
353
- *
354
- * @example "Sending approvals"
355
- */
356
- message: string;
357
- /**
358
- * The chain ID of the transaction.
359
- *
360
- * @default berachainChainId
361
- */
362
- chainId?: ChainId;
363
- /**
364
- * The type of transaction to be performed. It will be stored in the transaction history.
365
- *
366
- * Generally uses infinite tense.
367
- * @example TransactionActionType.APPROVAL => "Approve tokens"
368
- */
369
- actionType: TransactionActionType;
370
- txnName?: string;
371
- gasLimit?: bigint;
372
- account?: Account | Address;
373
- /**
374
- * Wheter the transaction can be sent by any account. Before setting this to true, make sure smart contract doesn't rely on `msg.sender`.
375
- *
376
- * Only transaction with permissionless flag set to true can be sent with overriden account.
377
- * Everything else will throw an error.
378
- */
379
- permissionless?: boolean;
380
- /**
381
- * The event to be tracked more specifically.
382
- * If not provided, the event will be tracked with the message and actionType.
383
- */
384
- track?: {
385
- eventName: string;
386
- eventData?: EventData;
387
- };
388
-
389
- /**
390
- * A wagmi config used to get wallet clients, switch chains, etc.
391
- *
392
- * This is preferred over providing clients as state updates are kept synched in this config object w/o re-rendering.
393
- */
394
- wagmiConfig?: Config;
395
-
396
- /**
397
- * walletClient should only be provided for tests or scripts.
398
- *
399
- * Wagmi Config is preferred.
400
- */
401
- walletClient?: GetWalletClientReturnType | undefined;
402
- /**
403
- * The name of the contract to be used for the transaction. By default, it will be devrel's contract mapping.
404
- * Custom values will be ignored if the address is already mapped in the devrel's contract mapping.
405
- *
406
- * @example "pol.rewardVault"
407
- */
408
- contractName?: ContractName;
409
- /**
410
- * This is a canonical list of ABIs that will be used to parse the error.
411
- *
412
- * This is an useful way to parse errors when providing raw data with no ABI.
413
- */
414
- errorsAbi?: Abi;
415
- } & IUseContractWriteArgs<abi, functionName, params> &
416
- (abi extends Abi
417
- ? {
418
- abi: abi;
419
- functionName: functionName;
420
- params: params;
421
- address: Address;
422
- calls?: never;
423
- value?: bigint;
424
- }
425
- :
426
- | {
427
- data: Hex;
428
- address: Address;
429
- value?: bigint;
430
- calls?: never;
431
- }
432
- | {
433
- value: bigint;
434
- address: Address;
435
- data?: Hex;
436
- calls?: never;
437
- }
438
- | {
439
- value?: never;
440
- address?: never;
441
- calls: (Omit<
442
- IContractWrite,
443
- | "calls"
444
- | "gasLimit"
445
- | "account"
446
- | "address"
447
- | "message"
448
- | "actionType"
449
- | TxnEventKeys
450
- > & {
451
- address: Address;
452
- })[];
453
- });
454
-
455
- declare global {
456
- export namespace BeraJS {
457
- export type BaseFunctionArgs = {
458
- /**
459
- * If only chainId is provided, config will be inferred from it
460
- *
461
- * @default `import { defaultChainId } from "@berachain/config/internal";`
462
- */
463
- chainId?: ChainId;
464
- /**
465
- * A config to infer the default values of the other arguments
466
- *
467
- * @default chainConfigs[chainId]
468
- */
469
- config?: BeraConfig;
470
- };
471
- }
472
- }
473
-
474
- export type { AggregatedTokenTotals as A, BribeBoostRewardProof as B, CustomProposal as C, DefaultHookOptions as D, GovernanceTopic as G, IContractWrite as I, ProtocolMetadata as P, StakingConfig as S, TxnEventKeys as T, UserVaultInfo as U, VerifiedAbi as V, CustomProposalErrors as a, BribeBoostRewardItem as b, DefaultHookReturnType as c, StakedBeraAsset as d, IUseContractWriteArgs as e, UseContractWriteApi as f, BribeBoostReward as g, BribeBoostValidatorApr as h, ClaimedIncentives as i, ClaimedIncentivesLocalState as j, CustomProposalActionErrors as k, IContractWriteFn as l, IncentiveReward as m, IncentiveRewardChunksWithValidatorData as n, PROPOSAL_GENRE as o, Proposal as p, ProposalAction as q, ProposalVotes as r, SafeProposalAction as s, Vote as t, Voter as u };
@@ -1,14 +0,0 @@
1
- declare enum HoneySwapAction {
2
- RESET_AMOUNTS = "RESET_AMOUNTS",
3
- ACTION_TYPE_CHANGE = "ACTION_TYPE_CHANGE",
4
- COLLATERALS_CHANGE = "COLLATERALS_CHANGE",
5
- FROM_AMOUNT_CHANGE = "FROM_AMOUNT_CHANGE",
6
- TO_AMOUNT_CHANGE = "TO_AMOUNT_CHANGE",
7
- PREVIEW_CHANGE = "PREVIEW_CHANGE",
8
- IS_BASKET_MODE_ENABLED_CHANGE = "IS_BASKET_MODE_ENABLED_CHANGE",
9
- IS_TYPING_CHANGE = "IS_TYPING_CHANGE",
10
- IS_SUBMITTING_CHANGE = "IS_SUBMITTING_CHANGE",
11
- IS_LOADING_CHANGE = "IS_LOADING_CHANGE"
12
- }
13
-
14
- export { HoneySwapAction as H };