@berachain/berajs 0.3.0 → 0.3.1
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/actions/clients/clientName.unit.test.d.ts +2 -0
- package/dist/actions/clients/clientName.unit.test.d.ts.map +1 -0
- package/dist/actions/clients/exports.mjs +3 -3
- package/dist/actions/clients/exports.mjs.map +1 -1
- package/dist/actions/clients/fetchBeep.d.ts +2 -2
- package/dist/actions/clients/fetchBeep.d.ts.map +1 -1
- package/dist/actions/clients/fetchEnso.d.ts +2 -2
- package/dist/actions/clients/fetchEnso.d.ts.map +1 -1
- package/dist/actions/clients/fetchLayerzero.d.ts +2 -2
- package/dist/actions/clients/fetchLayerzero.d.ts.map +1 -1
- package/dist/actions/clients/fetchOpenApi.unit.test.d.ts +2 -0
- package/dist/actions/clients/fetchOpenApi.unit.test.d.ts.map +1 -0
- package/dist/actions/dex/__tests__/aggregators.unit.test.d.ts +2 -0
- package/dist/actions/dex/__tests__/aggregators.unit.test.d.ts.map +1 -0
- package/dist/actions/dex/__tests__/allPools.integration.test.d.ts +2 -0
- package/dist/actions/dex/__tests__/allPools.integration.test.d.ts.map +1 -0
- package/dist/actions/dex/__tests__/getOnChainPool.unit.test.d.ts +2 -0
- package/dist/actions/dex/__tests__/getOnChainPool.unit.test.d.ts.map +1 -0
- package/dist/actions/dex/aggregators/enso/ensoErc4626.debug.test.d.ts +2 -0
- package/dist/actions/dex/aggregators/enso/ensoErc4626.debug.test.d.ts.map +1 -0
- package/dist/actions/dex/aggregators/haiku.integration.test.d.ts +2 -0
- package/dist/actions/dex/aggregators/haiku.integration.test.d.ts.map +1 -0
- package/dist/actions/enso/__tests__/getBendDemultiplyBundle.action.unit.test.d.ts +2 -0
- package/dist/actions/enso/__tests__/getBendDemultiplyBundle.action.unit.test.d.ts.map +1 -0
- package/dist/actions/enso/__tests__/getBendDemultiplyBundle.unit.test.d.ts +2 -0
- package/dist/actions/enso/__tests__/getBendDemultiplyBundle.unit.test.d.ts.map +1 -0
- package/dist/actions/enso/__tests__/getBendMultiplyBundle.action.unit.test.d.ts +2 -0
- package/dist/actions/enso/__tests__/getBendMultiplyBundle.action.unit.test.d.ts.map +1 -0
- package/dist/actions/enso/__tests__/getBendMultiplyBundle.unit.test.d.ts +2 -0
- package/dist/actions/enso/__tests__/getBendMultiplyBundle.unit.test.d.ts.map +1 -0
- package/dist/actions/enso/__tests__/getEnsoUserTokensWithBalances.debug.test.d.ts +2 -0
- package/dist/actions/enso/__tests__/getEnsoUserTokensWithBalances.debug.test.d.ts.map +1 -0
- package/dist/actions/enso/__tests__/util.unit.test.d.ts +2 -0
- package/dist/actions/enso/__tests__/util.unit.test.d.ts.map +1 -0
- package/dist/actions/exports.mjs +5 -17
- package/dist/actions/exports.mjs.map +1 -1
- package/dist/actions/governance/__tests__/checkProposalField.unit.test.d.ts +2 -0
- package/dist/actions/governance/__tests__/checkProposalField.unit.test.d.ts.map +1 -0
- package/dist/actions/governance/__tests__/getDecodedFunctionData.integration.test.d.ts +2 -0
- package/dist/actions/governance/__tests__/getDecodedFunctionData.integration.test.d.ts.map +1 -0
- package/dist/actions/governance/__tests__/getQuorum.integration.test.d.ts +2 -0
- package/dist/actions/governance/__tests__/getQuorum.integration.test.d.ts.map +1 -0
- package/dist/actions/honey/getChartData.d.ts +1 -1
- package/dist/actions/honey/getChartData.d.ts.map +1 -1
- package/dist/actions/honey/getHoneyTxns.d.ts +1 -1
- package/dist/actions/honey/getHoneyTxns.d.ts.map +1 -1
- package/dist/actions/honey/tests/pyth.integration.test.d.ts +2 -0
- package/dist/actions/honey/tests/pyth.integration.test.d.ts.map +1 -0
- package/dist/actions/pol/__tests__/getAllValidators.integration.test.d.ts +2 -0
- package/dist/actions/pol/__tests__/getAllValidators.integration.test.d.ts.map +1 -0
- package/dist/actions/pol/__tests__/getValidator.integration.test.d.ts +2 -0
- package/dist/actions/pol/__tests__/getValidator.integration.test.d.ts.map +1 -0
- package/dist/actions/pol/__tests__/rewardVaults.integration.test.d.ts +2 -0
- package/dist/actions/pol/__tests__/rewardVaults.integration.test.d.ts.map +1 -0
- package/dist/actions/pol/getBGTGlobalInfo.d.ts +0 -1
- package/dist/actions/pol/getBGTGlobalInfo.d.ts.map +1 -1
- package/dist/actions/pol/getBeraTokenTotalSupply.d.ts.map +1 -1
- package/dist/actions/pol/getBgtAprSimultaion.unit.test.d.ts +2 -0
- package/dist/actions/pol/getBgtAprSimultaion.unit.test.d.ts.map +1 -0
- package/dist/actions/pol/getBlockTime.debug.test.d.ts +2 -0
- package/dist/actions/pol/getBlockTime.debug.test.d.ts.map +1 -0
- package/dist/actions/pol/getEarnedStakedBeraVault.d.ts +4 -4
- package/dist/actions/pol/getEarnedStakedBeraVault.d.ts.map +1 -1
- package/dist/actions/pol/getRewardVaultBeaconImplementation.integration.test.d.ts +2 -0
- package/dist/actions/pol/getRewardVaultBeaconImplementation.integration.test.d.ts.map +1 -0
- package/dist/actions/pol/getRewardVaultDurationConstants.integration.test.d.ts +2 -0
- package/dist/actions/pol/getRewardVaultDurationConstants.integration.test.d.ts.map +1 -0
- package/dist/actions/pol/getRewardVaults.d.ts.map +1 -1
- package/dist/actions/pol/getStakedBeraAPY.d.ts.map +1 -1
- package/dist/actions/pol/getStakedBeraSnapshots.d.ts +1 -1
- package/dist/actions/pol/getStakedBeraSnapshots.d.ts.map +1 -1
- package/dist/actions/pol/getStakingDailyAssets.d.ts +2 -2
- package/dist/actions/pol/getStakingDailyAssets.d.ts.map +1 -1
- package/dist/actions/prices/__tests__/prices.integration.test.d.ts +2 -0
- package/dist/actions/prices/__tests__/prices.integration.test.d.ts.map +1 -0
- package/dist/actions/server/exports.mjs +1 -1
- package/dist/actions/server/exports.mjs.map +1 -1
- package/dist/actions/server/getDailyValidatorBlockStats.d.ts +1 -1
- package/dist/actions/server/getDailyValidatorBlockStats.d.ts.map +1 -1
- package/dist/actions/tokens/getWalletBalances.integration.test.d.ts +2 -0
- package/dist/actions/tokens/getWalletBalances.integration.test.d.ts.map +1 -0
- package/dist/actions/transactions/beraWriteContract.integration.test.d.ts +2 -0
- package/dist/actions/transactions/beraWriteContract.integration.test.d.ts.map +1 -0
- package/dist/actions/validators/getActiveBoostAndCommissionChangeDelay.integration.test.d.ts +2 -0
- package/dist/actions/validators/getActiveBoostAndCommissionChangeDelay.integration.test.d.ts.map +1 -0
- package/dist/actions/validators/getValidatorIncentiveDistribution.d.ts +1 -1
- package/dist/actions/validators/getValidatorIncentiveDistribution.d.ts.map +1 -1
- package/dist/actions/validators/utils/__tests__/validatorUtils.integration.test.d.ts +2 -0
- package/dist/actions/validators/utils/__tests__/validatorUtils.integration.test.d.ts.map +1 -0
- package/dist/actions/validators/utils/aggregateValidatorIncentives.unit.test.d.ts +2 -0
- package/dist/actions/validators/utils/aggregateValidatorIncentives.unit.test.d.ts.map +1 -0
- package/dist/{chunk-J6GM7HWX.mjs → chunk-3TRTSTDH.mjs} +1 -1
- package/dist/chunk-3TRTSTDH.mjs.map +1 -0
- package/dist/{chunk-BZKA6DBM.mjs → chunk-5MUCX35C.mjs} +2 -2
- package/dist/{chunk-5PBYMJRG.mjs → chunk-6D4S3EAC.mjs} +3 -3
- package/dist/chunk-6D4S3EAC.mjs.map +1 -0
- package/dist/{chunk-7OESHTBN.mjs → chunk-GDUKRUHE.mjs} +1 -1
- package/dist/chunk-GDUKRUHE.mjs.map +1 -0
- package/dist/{chunk-SMBAW7AG.mjs → chunk-KY7JMIIS.mjs} +3 -5
- package/dist/chunk-KY7JMIIS.mjs.map +1 -0
- package/dist/{chunk-BSLXKPX4.mjs → chunk-Z337NBBW.mjs} +2 -2
- package/dist/chunk-Z337NBBW.mjs.map +1 -0
- package/dist/contexts/exports.mjs +1 -1
- package/dist/enum/exports.mjs +1 -1
- package/dist/enum/txnEnum.d.ts +1 -1
- package/dist/enum/txnEnum.d.ts.map +1 -1
- package/dist/errors/BeraError.unit.test.d.ts +2 -0
- package/dist/errors/BeraError.unit.test.d.ts.map +1 -0
- package/dist/errors/BeraTracing.unit.test.d.ts +2 -0
- package/dist/errors/BeraTracing.unit.test.d.ts.map +1 -0
- package/dist/errors/RequestError.unit.test.d.ts +2 -0
- package/dist/errors/RequestError.unit.test.d.ts.map +1 -0
- package/dist/errors/assert.unit.test.d.ts +2 -0
- package/dist/errors/assert.unit.test.d.ts.map +1 -0
- package/dist/errors/getErrorMessage.unit.test.d.ts +2 -0
- package/dist/errors/getErrorMessage.unit.test.d.ts.map +1 -0
- package/dist/errors/getRevertReason.integration.test.d.ts +2 -0
- package/dist/errors/getRevertReason.integration.test.d.ts.map +1 -0
- package/dist/errors/spanStatus.unit.test.d.ts +2 -0
- package/dist/errors/spanStatus.unit.test.d.ts.map +1 -0
- package/dist/generated/beep.d.ts +1597 -0
- package/dist/generated/beep.d.ts.map +1 -0
- package/dist/generated/enso.d.ts +4957 -0
- package/dist/generated/enso.d.ts.map +1 -0
- package/dist/generated/layerzero.d.ts +2057 -0
- package/dist/generated/layerzero.d.ts.map +1 -0
- package/dist/hooks/dex/useCrossChainNativeFee.unit.test.d.ts +2 -0
- package/dist/hooks/dex/useCrossChainNativeFee.unit.test.d.ts.map +1 -0
- package/dist/hooks/dex/useSingleAggregatorQuote.d.ts.map +1 -1
- package/dist/hooks/dex/useSingleAggregatorQuote.unit.test.d.ts +2 -0
- package/dist/hooks/dex/useSingleAggregatorQuote.unit.test.d.ts.map +1 -0
- package/dist/hooks/enso/useBendZapSupply.d.ts.map +1 -1
- package/dist/hooks/enso/useBendZapSupply.unit.test.d.ts +2 -0
- package/dist/hooks/enso/useBendZapSupply.unit.test.d.ts.map +1 -0
- package/dist/hooks/enso/useEnsoUserTokensWithBalances.d.ts.map +1 -1
- package/dist/hooks/enso/useEnsoUserTokensWithBalances.unit.test.d.ts +2 -0
- package/dist/hooks/enso/useEnsoUserTokensWithBalances.unit.test.d.ts.map +1 -0
- package/dist/hooks/enso/useZapStakeBera.d.ts.map +1 -1
- package/dist/hooks/enso/useZapStakeBera.unit.test.d.ts +2 -0
- package/dist/hooks/enso/useZapStakeBera.unit.test.d.ts.map +1 -0
- package/dist/hooks/exports.mjs +38 -19
- package/dist/hooks/exports.mjs.map +1 -1
- package/dist/hooks/honey/useHoneyChartData.d.ts +4 -4
- package/dist/hooks/honey/useHoneyChartData.d.ts.map +1 -1
- package/dist/hooks/pol/useAutoclaimedIncentives.d.ts.map +1 -1
- package/dist/hooks/pol/useAutoclaimedIncentivesTxHash.d.ts.map +1 -1
- package/dist/hooks/pol/useRewardVaults.d.ts.map +1 -1
- package/dist/hooks/pol/useStakedData.d.ts +2 -0
- package/dist/hooks/pol/useStakedData.d.ts.map +1 -1
- package/dist/hooks/pol/useStakedSnapshots.d.ts +1 -1
- package/dist/hooks/pol/useStakedSnapshots.d.ts.map +1 -1
- package/dist/hooks/tokens/useMultipleTokenInformation.unit.test.d.ts +2 -0
- package/dist/hooks/tokens/useMultipleTokenInformation.unit.test.d.ts.map +1 -0
- package/dist/hooks/validators/useValidator.d.ts +0 -1
- package/dist/hooks/validators/useValidator.d.ts.map +1 -1
- package/dist/hooks/validators/useValidatorIncentiveDistribution.d.ts +1 -1
- package/dist/hooks/validators/useValidatorIncentiveDistribution.d.ts.map +1 -1
- package/dist/types/beep/exports.d.ts +2 -0
- package/dist/types/beep/exports.d.ts.map +1 -0
- package/dist/types/beep/exports.mjs +1 -0
- package/dist/types/beep/exports.mjs.map +1 -0
- package/dist/types/bribeBoost.d.ts +20 -0
- package/dist/types/dex.d.ts +242 -0
- package/dist/types/enso.d.ts +50 -0
- package/dist/types/global.d.ts +205 -0
- package/dist/types/governance.d.ts +112 -0
- package/dist/types/honeySwap.d.ts +23 -0
- package/dist/types/pol.d.ts +33 -0
- package/dist/types/staking.d.ts +22 -0
- package/dist/utils/createEmitter.unit.test.d.ts +2 -0
- package/dist/utils/createEmitter.unit.test.d.ts.map +1 -0
- package/dist/utils/crossChainBridge.unit.test.d.ts +2 -0
- package/dist/utils/crossChainBridge.unit.test.d.ts.map +1 -0
- package/dist/utils/exports.mjs +1 -1
- package/dist/utils/formatNumber.unit.test.d.ts +2 -0
- package/dist/utils/formatNumber.unit.test.d.ts.map +1 -0
- package/dist/utils/formatTimestamps.unit.test.d.ts +2 -0
- package/dist/utils/formatTimestamps.unit.test.d.ts.map +1 -0
- package/dist/utils/getContractName.unit.test.d.ts +2 -0
- package/dist/utils/getContractName.unit.test.d.ts.map +1 -0
- package/dist/utils/getHoneySwapMessage.test.d.ts +2 -0
- package/dist/utils/getHoneySwapMessage.test.d.ts.map +1 -0
- package/dist/utils/math.unit.test.d.ts +2 -0
- package/dist/utils/math.unit.test.d.ts.map +1 -0
- package/dist/utils/parseBaseArgs.unit.test.d.ts +2 -0
- package/dist/utils/parseBaseArgs.unit.test.d.ts.map +1 -0
- package/dist/utils/polyfillAbortSignalAny.unit.test.d.ts +2 -0
- package/dist/utils/polyfillAbortSignalAny.unit.test.d.ts.map +1 -0
- package/dist/utils/time.unit.test.d.ts +2 -0
- package/dist/utils/time.unit.test.d.ts.map +1 -0
- package/dist/utils/tokens.unit.test.d.ts +2 -0
- package/dist/utils/tokens.unit.test.d.ts.map +1 -0
- package/dist/utils/truncateHash.unit.test.d.ts +2 -0
- package/dist/utils/truncateHash.unit.test.d.ts.map +1 -0
- package/package.json +9 -7
- package/src/actions/clients/fetchBeep.ts +2 -3
- package/src/actions/clients/fetchEnso.ts +2 -3
- package/src/actions/clients/fetchLayerzero.ts +2 -3
- package/src/actions/clients/fetchOpenApi.unit.test.ts +1 -2
- package/src/actions/honey/getChartData.ts +2 -3
- package/src/actions/honey/getHoney24hVolume.ts +1 -1
- package/src/actions/honey/getHoneyTxns.ts +2 -3
- package/src/actions/pol/getBGTGlobalInfo.ts +0 -2
- package/src/actions/pol/getEarnedStakedBeraVault.ts +1 -1
- package/src/actions/pol/getRewardVaults.ts +0 -1
- package/src/actions/pol/getStakedBeraAPY.ts +1 -2
- package/src/actions/pol/getStakedBeraSnapshots.ts +1 -2
- package/src/actions/pol/getStakingDailyAssets.ts +1 -1
- package/src/actions/server/getDailyValidatorBlockStats.ts +1 -2
- package/src/actions/validators/getValidatorIncentiveDistribution.ts +1 -2
- package/src/enum/txnEnum.ts +1 -1
- package/src/generated/beep.ts +1605 -0
- package/src/generated/enso.ts +4965 -0
- package/src/generated/layerzero.ts +2065 -0
- package/src/hooks/dex/useSingleAggregatorQuote.ts +6 -3
- package/src/hooks/dex/useSingleAggregatorQuote.unit.test.ts +86 -0
- package/src/hooks/enso/useBendZapSupply.ts +1 -0
- package/src/hooks/enso/useBendZapSupply.unit.test.ts +98 -0
- package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +3 -1
- package/src/hooks/enso/useEnsoUserTokensWithBalances.unit.test.ts +69 -0
- package/src/hooks/enso/useZapStakeBera.ts +7 -0
- package/src/hooks/enso/useZapStakeBera.unit.test.ts +97 -0
- package/src/hooks/pol/useStakedData.ts +2 -0
- package/src/hooks/pol/useStakedSnapshots.ts +1 -1
- package/src/hooks/validators/useValidatorIncentiveDistribution.ts +1 -1
- package/src/types/beep/exports.ts +4 -0
- package/dist/chunk-5PBYMJRG.mjs.map +0 -1
- package/dist/chunk-7OESHTBN.mjs.map +0 -1
- package/dist/chunk-BSLXKPX4.mjs.map +0 -1
- package/dist/chunk-J6GM7HWX.mjs.map +0 -1
- package/dist/chunk-SMBAW7AG.mjs.map +0 -1
- /package/dist/{chunk-BZKA6DBM.mjs.map → chunk-5MUCX35C.mjs.map} +0 -0
|
@@ -2,9 +2,9 @@ export declare function useHoneyChartData({ days }: {
|
|
|
2
2
|
days: number;
|
|
3
3
|
}): import("@berachain/utils/pkg/swr").BeraSwrResponse<{
|
|
4
4
|
timestamp: number;
|
|
5
|
-
mintVolume: import("
|
|
6
|
-
redeemVolume: import("
|
|
7
|
-
totalVolume: import("
|
|
8
|
-
totalSupply: import("
|
|
5
|
+
mintVolume: import("../../generated/beep").components["schemas"]["DecimalStr"];
|
|
6
|
+
redeemVolume: import("../../generated/beep").components["schemas"]["DecimalStr"];
|
|
7
|
+
totalVolume: import("../../generated/beep").components["schemas"]["DecimalStr"];
|
|
8
|
+
totalSupply: import("../../generated/beep").components["schemas"]["DecimalStr"];
|
|
9
9
|
}[], any>;
|
|
10
10
|
//# sourceMappingURL=useHoneyChartData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoneyChartData.d.ts","sourceRoot":"","sources":["../../../src/hooks/honey/useHoneyChartData.ts"],"names":[],"mappings":"AAIA,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;;
|
|
1
|
+
{"version":3,"file":"useHoneyChartData.d.ts","sourceRoot":"","sources":["../../../src/hooks/honey/useHoneyChartData.ts"],"names":[],"mappings":"AAIA,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;;gBAKgsjB,oDAAsB;kBAAyC,oDAAsB;iBAAwC,oDAAsB;iBAAwC,oDAAsB;UAD58jB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoclaimedIncentives.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useAutoclaimedIncentives.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"useAutoclaimedIncentives.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useAutoclaimedIncentives.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhE,UAAU,4BAA4B;IAIpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,GACR,EAAE,4BAA4B,GAAG,qBAAqB,CAAC,6BAA6B,GAAG,IAAI,CAAC,CAmB5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoclaimedIncentivesTxHash.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useAutoclaimedIncentivesTxHash.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"useAutoclaimedIncentivesTxHash.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useAutoclaimedIncentivesTxHash.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhE,UAAU,kCAAkC;IAG1C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,OAAO,GACR,EAAE,kCAAkC,GAAG,qBAAqB,CAAC,mCAAmC,GAAG,IAAI,CAAC,CAwBxG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRewardVaults.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useRewardVaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAK1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,wBAAgB,uBAAuB,CACrC,MAAM,CAAC,EAAE,uBAAuB,EAChC,iBAAiB,UAAQ;;+
|
|
1
|
+
{"version":3,"file":"useRewardVaults.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useRewardVaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAK1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,wBAAgB,uBAAuB,CACrC,MAAM,CAAC,EAAE,uBAAuB,EAChC,iBAAiB,UAAQ;;+DA4B4vlG,mDAAc;2DAAkC,mDAAc;;;6DAAoJ,sDAAiB;yBAzBz/lG;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE;IACJ,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,EACD,OAAO,CAAC,EAAE,kBAAkB,2HAiB7B"}
|
|
@@ -13,6 +13,8 @@ import type { StakingConfig } from "../../types/staking";
|
|
|
13
13
|
* Consumers can show `balances` right away and swap in `data` once positions resolve.
|
|
14
14
|
*/
|
|
15
15
|
export declare function useStakedData(stakingConfigs: StakingConfig[]): {
|
|
16
|
+
/** Overall staked-BERA APY. Wallet-independent. */
|
|
17
|
+
apy: number | undefined;
|
|
16
18
|
/** Fast path: staked amounts + USD values (no earnings) */
|
|
17
19
|
balances: StakedBeraAsset[] | undefined;
|
|
18
20
|
/** Slow path: full enriched positions with earnings */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStakedData.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useStakedData.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,aAAa,EAAE;IA2LzD,2DAA2D;;IAE3D,uDAAuD;;IAEvD,mEAAmE;;;;;IAKnE;;;;;OAKG;;IAEH,wDAAwD;;IAExD;;;;OAIG;;EAGN"}
|
|
1
|
+
{"version":3,"file":"useStakedData.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useStakedData.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,aAAa,EAAE;IA2LzD,mDAAmD;;IAEnD,2DAA2D;;IAE3D,uDAAuD;;IAEvD,mEAAmE;;;;;IAKnE;;;;;OAKG;;IAEH,wDAAwD;;IAExD;;;;OAIG;;EAGN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
|
-
import type { StakeStatsByDayResponse } from "
|
|
2
|
+
import type { StakeStatsByDayResponse } from "../../generated/beep";
|
|
3
3
|
import type { DefaultHookReturnType } from "../../types/global";
|
|
4
4
|
type UseStakedBeraSnapshot = Record<Address, StakeStatsByDayResponse>;
|
|
5
5
|
export declare function useStakedSnapshots({ range, addresses, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStakedSnapshots.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useStakedSnapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"useStakedSnapshots.d.ts","sourceRoot":"","sources":["../../../src/hooks/pol/useStakedSnapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAKpC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhE,KAAK,qBAAqB,GAAG,MAAM,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;AACtE,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,SAAS,GACV,EAAE;IACD,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;CACrB,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,CA0B/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMultipleTokenInformation.unit.test.d.ts","sourceRoot":"","sources":["../../../src/hooks/tokens/useMultipleTokenInformation.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -50,7 +50,6 @@ export declare function useValidator({ pubkey }: {
|
|
|
50
50
|
address: `0x${string}`;
|
|
51
51
|
dynamicData?: {
|
|
52
52
|
__typename?: "GqlRewardVaultDynamicData";
|
|
53
|
-
allTimeRewards: string;
|
|
54
53
|
apr?: number | null;
|
|
55
54
|
rewardCapturePercentage: number;
|
|
56
55
|
rewardCapturePerBlock: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useValidator.d.ts","sourceRoot":"","sources":["../../../src/hooks/validators/useValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAa,MAAM,MAAM,CAAC;AAE/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAG1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAI7D,wBAAgB,YAAY,CAC1B,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,EAC/B,OAAO,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;0BAkDL,uBAAuB,CAAC,UAAU,CAAC;;;gBAIS,OAAO;oBAE9B,OAAO;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useValidator.d.ts","sourceRoot":"","sources":["../../../src/hooks/validators/useValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAa,MAAM,MAAM,CAAC;AAE/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAG1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAI7D,wBAAgB,YAAY,CAC1B,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,EAC/B,OAAO,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;0BAkDL,uBAAuB,CAAC,UAAU,CAAC;;;gBAIS,OAAO;oBAE9B,OAAO;;;;;;;;;;;;;;8BAc0wwG,CAAC;;;;;;+BAAwO,CAAC;kCAA8B,CAAC;2BAAkD,CAAC;;;;;2BAAuO,CAAC;;;kCAA6F,CAAC;;;;;;4BAAyL,CAAC;kCAA8B,CAAC;;;;;;;;;;;kCAA0Y,CAAC;;;;;;;;sCAAwU,CAAC;;;;;;;;;;;;;;;;;;;;;;;EAD52zG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
|
-
import type { ValidatorIncentivesResponse } from "
|
|
2
|
+
import type { ValidatorIncentivesResponse } from "../../generated/beep";
|
|
3
3
|
import type { DefaultHookReturnType } from "../../types/global";
|
|
4
4
|
/**
|
|
5
5
|
* Historical per-validator incentive distribution, powering the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useValidatorIncentiveDistribution.d.ts","sourceRoot":"","sources":["../../../src/hooks/validators/useValidatorIncentiveDistribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"useValidatorIncentiveDistribution.d.ts","sourceRoot":"","sources":["../../../src/hooks/validators/useValidatorIncentiveDistribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAMpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,EAChD,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,qBAAqB,CAAC,2BAA2B,CAAC,CAerD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/types/beep/exports.ts"],"names":[],"mappings":"AAGA,mBAAmB,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=exports.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
|
|
3
|
+
// Response shape of GET /api/v1/wallets/:wallet/autoclaimed:
|
|
4
|
+
// { [wallet]: { [validatorPubkey]: { [tokenAddress]: { amount } } } }
|
|
5
|
+
// `amount` is a stringified bigint in token base units. The backend now
|
|
6
|
+
// aggregates across validators under a single fake pubkey (`0x000…000`),
|
|
7
|
+
// so consumers can collapse the validator dimension blindly.
|
|
8
|
+
export type AutoclaimedIncentivesResponse = Record<
|
|
9
|
+
Address,
|
|
10
|
+
Record<Address, Record<Address, { amount: string }>>
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
// Response shape of GET /api/v1/wallets/:wallet/autoclaimed/txhash: same
|
|
14
|
+
// nesting, but each token leaf is `{ txhash }`. Tokens still pending are
|
|
15
|
+
// simply absent — when a token from `/autoclaimed` has no entry here, the
|
|
16
|
+
// bot hasn't distributed it yet.
|
|
17
|
+
export type AutoclaimedIncentivesTxHashResponse = Record<
|
|
18
|
+
Address,
|
|
19
|
+
Record<Address, Record<Address, { txhash: string }>>
|
|
20
|
+
>;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import type { SwapKind } from "@berachain-foundation/berancer-sdk";
|
|
2
|
+
import type { Abi, Address, Hex, PublicClient } from "viem";
|
|
3
|
+
|
|
4
|
+
import type { HoneyConfigContextReturn } from "../contexts/HoneyConfigProvider";
|
|
5
|
+
|
|
6
|
+
export type MinimalERC20 = {
|
|
7
|
+
address: Address;
|
|
8
|
+
decimals: number;
|
|
9
|
+
symbol: string;
|
|
10
|
+
name: string;
|
|
11
|
+
chainId: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type TokenWithMetadata = MinimalERC20 & {
|
|
15
|
+
tags?: string[];
|
|
16
|
+
base64?: string;
|
|
17
|
+
logoURI?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type Token = TokenWithMetadata & {
|
|
21
|
+
totalSupply?: string;
|
|
22
|
+
weight?: number | string | null;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export interface TokenPriceInfo {
|
|
26
|
+
price: number;
|
|
27
|
+
updatedAt: number;
|
|
28
|
+
chainId: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type TokenCurrentPriceMap = Record<
|
|
32
|
+
Lowercase<Address> | string,
|
|
33
|
+
TokenPriceInfo | undefined
|
|
34
|
+
>;
|
|
35
|
+
|
|
36
|
+
export interface TokenWithAmount extends Token {
|
|
37
|
+
amount: string;
|
|
38
|
+
exceeding?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface TokenWithPrice extends Token {
|
|
42
|
+
price: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface BalanceToken extends Token {
|
|
46
|
+
balance: {
|
|
47
|
+
/**
|
|
48
|
+
* This is the string representation of the balance in wei.
|
|
49
|
+
*
|
|
50
|
+
* It can be safely parsed to a bigint, but we're returning it as a string to avoid serialization issues.
|
|
51
|
+
*
|
|
52
|
+
* @example "1200000000000000000"
|
|
53
|
+
*/
|
|
54
|
+
raw: string;
|
|
55
|
+
/**
|
|
56
|
+
* This is the formatted representation of the balance in the token's decimals.
|
|
57
|
+
*
|
|
58
|
+
* @example "1.2"
|
|
59
|
+
*/
|
|
60
|
+
formatted: string;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Price of the token in USD.
|
|
64
|
+
*/
|
|
65
|
+
price?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Balance value in USD.
|
|
68
|
+
* Calculated as balance * price.
|
|
69
|
+
*/
|
|
70
|
+
usdValue?: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface SwapRequest {
|
|
74
|
+
tokenIn: Address;
|
|
75
|
+
tokenOut: Address;
|
|
76
|
+
tokenInDecimals: number;
|
|
77
|
+
tokenOutDecimals: number;
|
|
78
|
+
amount: string;
|
|
79
|
+
wberaIsBera: boolean;
|
|
80
|
+
swapKind: SwapKind;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Object with properties to check the allowance of a token.
|
|
85
|
+
*/
|
|
86
|
+
export interface AllowanceQueryItem {
|
|
87
|
+
token: MinimalERC20;
|
|
88
|
+
/**
|
|
89
|
+
* The amount of the token to approve.
|
|
90
|
+
*/
|
|
91
|
+
amount: {
|
|
92
|
+
raw: string;
|
|
93
|
+
formatted: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The address to approve the tokens to.
|
|
97
|
+
*/
|
|
98
|
+
spender: Address;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface AllowanceToken extends AllowanceQueryItem {
|
|
102
|
+
/**
|
|
103
|
+
* The current allowance of the token.
|
|
104
|
+
*/
|
|
105
|
+
allowance: {
|
|
106
|
+
raw: string;
|
|
107
|
+
formatted: string;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Whether the allowance is needed to perform the transaction.
|
|
111
|
+
*/
|
|
112
|
+
needsApproval: boolean;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface IUserPosition {
|
|
116
|
+
lpBalance?: BalanceToken;
|
|
117
|
+
tokenBalances?: Omit<BalanceToken, "chainId">[];
|
|
118
|
+
userSharePercentage?: number;
|
|
119
|
+
stakedBalance?: Pick<BalanceToken, "address" | "balance" | "usdValue">;
|
|
120
|
+
/**
|
|
121
|
+
* Just a utility to detect if there is a price for the LP token.
|
|
122
|
+
*/
|
|
123
|
+
lpTokenPrice?: number;
|
|
124
|
+
}
|
|
125
|
+
export type BexStatus = {
|
|
126
|
+
protocol: {
|
|
127
|
+
/**
|
|
128
|
+
* If the whole protocol is paused (i.e. ~the~ vault contract) disable any functionality except withdrawing proportional
|
|
129
|
+
* liquidity (provided that pool's recovery mode is enabled). Specifically we disable swaps and pool creation.
|
|
130
|
+
*/
|
|
131
|
+
isPaused: boolean;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Pool is undefined if pool status is still loading if no pool address was provided.
|
|
135
|
+
*/
|
|
136
|
+
pool?: {
|
|
137
|
+
/**
|
|
138
|
+
* Pool should be put into recovery mode if tx are reverting on-chain to do with fee computation or pool exits.
|
|
139
|
+
* It reduces the computation needed to withdraw liquidity and does not charge protocol fees on exits while enabled.
|
|
140
|
+
*
|
|
141
|
+
* NOTE: that you can potentially still do regular exits/joins/etc in recovery mode, but if the flag is true will only
|
|
142
|
+
* present the safe exit option to the user in FE.
|
|
143
|
+
*/
|
|
144
|
+
isInRecoveryMode: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* If the pool is paused you cannot do anything unless you also enable recovery mode (then you can withdraw safely).
|
|
147
|
+
*/
|
|
148
|
+
isPaused: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Disable withdrawals for a pool due to a combination of pool and vault statuses.
|
|
151
|
+
*/
|
|
152
|
+
disablePoolWithdrawals: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Disable deposits for a pool due to a combination of pool and vault statuses.
|
|
155
|
+
*/
|
|
156
|
+
disablePoolDeposits: boolean;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export type IAggregatorArgs = {
|
|
161
|
+
tokenIn: MinimalERC20;
|
|
162
|
+
tokenOut: MinimalERC20;
|
|
163
|
+
/**
|
|
164
|
+
* Amount of tokenIn to swap in wei.
|
|
165
|
+
*/
|
|
166
|
+
amount: string;
|
|
167
|
+
slippage: number;
|
|
168
|
+
account?: Address;
|
|
169
|
+
publicClient?: PublicClient;
|
|
170
|
+
aggregatorsFeeBps?: number;
|
|
171
|
+
proxyAggregatorsThroughVercel?: boolean;
|
|
172
|
+
referrer?: SwapReferrer;
|
|
173
|
+
/**
|
|
174
|
+
* If provided, the aggregator will swap to the underlying token and deposit it into the vault (tokenOut).
|
|
175
|
+
*
|
|
176
|
+
* The aggregator won't check if the tokenOut is an ERC4626 vault, so this needs to be asserted by the caller.
|
|
177
|
+
* This is used for Staked BERA/iBera and Bend Vaults.
|
|
178
|
+
*/
|
|
179
|
+
underlyingToken?: MinimalERC20 | null;
|
|
180
|
+
/**
|
|
181
|
+
* If provided, the aggregator will stake into the reward vault after the swap.
|
|
182
|
+
*/
|
|
183
|
+
rewardVault?: Address;
|
|
184
|
+
/**
|
|
185
|
+
* Only needed by the honey mint/redeem aggregator.
|
|
186
|
+
*/
|
|
187
|
+
honeyNativeState?: Pick<HoneyConfigContextReturn, "collateralList">;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export type Calldata = {
|
|
191
|
+
params?: readonly unknown[] | undefined;
|
|
192
|
+
functionName?: string;
|
|
193
|
+
abi?: Abi;
|
|
194
|
+
address: Address;
|
|
195
|
+
data?: Hex;
|
|
196
|
+
value: bigint;
|
|
197
|
+
gasLimit?: bigint;
|
|
198
|
+
/**
|
|
199
|
+
* Extra Sentry tags to attach when this calldata is submitted via `useTxn`.
|
|
200
|
+
* Aggregators set `{ aggregator: this.name }` so failures like
|
|
201
|
+
* AggregatorNotWhitelisted can be attributed to a source without decoding
|
|
202
|
+
* calldata.
|
|
203
|
+
*/
|
|
204
|
+
extraTags?: Record<string, string>;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export type IRawAggregatorQuote = {
|
|
208
|
+
amountOut: string;
|
|
209
|
+
amountIn: string;
|
|
210
|
+
name: Aggregators;
|
|
211
|
+
allowanceRequirements: AllowanceQueryItem[];
|
|
212
|
+
/**
|
|
213
|
+
* True if it's bera wrap/unwrap or bgt redeem.
|
|
214
|
+
*/
|
|
215
|
+
isNativeSwap?: boolean;
|
|
216
|
+
priceImpactPercentage?: number | null;
|
|
217
|
+
swapFeeBps: number;
|
|
218
|
+
/** True when the route bridges chains; set by the aggregator (source of truth). */
|
|
219
|
+
isCrossChain?: boolean;
|
|
220
|
+
/** Chain the input token (and therefore the tx) lives on. */
|
|
221
|
+
srcChainId?: number;
|
|
222
|
+
/**
|
|
223
|
+
* Bridge the cross-chain route uses, from Enso's chosen bridge hop
|
|
224
|
+
* (`relay` | `stargate` | `ccip`). Drives which explorer/status API the
|
|
225
|
+
* tracker uses; undefined for same-chain routes.
|
|
226
|
+
*/
|
|
227
|
+
bridgeProtocol?: string;
|
|
228
|
+
getCalldata?: ({ account }: { account: Address }) => Calldata;
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export type IAggregatorQuote =
|
|
232
|
+
// no need to force to swapAndStake as type check is done on each getQuote
|
|
233
|
+
IRawAggregatorQuote & {
|
|
234
|
+
amountOut: string;
|
|
235
|
+
amountOutUsd: string;
|
|
236
|
+
amountIn: string;
|
|
237
|
+
amountInUsd: string;
|
|
238
|
+
priceImpactPercentage: number;
|
|
239
|
+
exchangeRate: number;
|
|
240
|
+
relativeLossPercentage: number;
|
|
241
|
+
isBest?: boolean;
|
|
242
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { BundleData } from "@ensofinance/sdk";
|
|
2
|
+
import type { Address, Hex, PublicClient, TransactionRequest } from "viem";
|
|
3
|
+
|
|
4
|
+
import type { MinimalERC20 } from "./dex";
|
|
5
|
+
|
|
6
|
+
export type Quantity = string | number;
|
|
7
|
+
|
|
8
|
+
export type GetZapTransaction = TransactionRequest & {
|
|
9
|
+
to: Address;
|
|
10
|
+
data: Hex;
|
|
11
|
+
value?: bigint;
|
|
12
|
+
gasLimit?: bigint;
|
|
13
|
+
};
|
|
14
|
+
export type GetZapTransactions = GetZapTransaction[];
|
|
15
|
+
|
|
16
|
+
export interface GetEnsoWalletTransactionsWithApprovalArgs {
|
|
17
|
+
fromAddress: Address;
|
|
18
|
+
amountIn: Quantity;
|
|
19
|
+
tokenIn: MinimalERC20;
|
|
20
|
+
bundle: BundleData;
|
|
21
|
+
publicClient: PublicClient;
|
|
22
|
+
}
|
|
23
|
+
export interface GetZapTransactionResponse {
|
|
24
|
+
bundle: BundleData;
|
|
25
|
+
transactions: GetZapTransactions;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface BendPositionEstimate {
|
|
29
|
+
/**
|
|
30
|
+
* Collateral amount in human-readable format.
|
|
31
|
+
* For multiply: total collateral after leveraging.
|
|
32
|
+
* For demultiply: collateral reduction from unwinding.
|
|
33
|
+
*/
|
|
34
|
+
finalCollateral: string;
|
|
35
|
+
/**
|
|
36
|
+
* Borrow amount in loan tokens (human-readable).
|
|
37
|
+
* For multiply: total debt after leveraging.
|
|
38
|
+
* For demultiply: debt reduction from unwinding.
|
|
39
|
+
*/
|
|
40
|
+
totalBorrow: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface BendMultiplyBundleResponse extends GetZapTransactionResponse {
|
|
44
|
+
positionEstimate: BendPositionEstimate;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface BendDemultiplyBundleResponse
|
|
48
|
+
extends GetZapTransactionResponse {
|
|
49
|
+
positionEstimate: BendPositionEstimate;
|
|
50
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import type { Config, GetWalletClientReturnType } from "@wagmi/core";
|
|
2
|
+
import type {
|
|
3
|
+
Abi,
|
|
4
|
+
Account,
|
|
5
|
+
Address,
|
|
6
|
+
ContractFunctionArgs,
|
|
7
|
+
ContractFunctionName,
|
|
8
|
+
Hex,
|
|
9
|
+
TransactionReceipt,
|
|
10
|
+
WalletCallReceipt,
|
|
11
|
+
} from "viem";
|
|
12
|
+
|
|
13
|
+
import type { BeraConfig, ChainId } from "@berachain/config";
|
|
14
|
+
|
|
15
|
+
import type {
|
|
16
|
+
BeraSwrResponse,
|
|
17
|
+
SWRConfiguration,
|
|
18
|
+
} from "@berachain/utils/pkg/swr";
|
|
19
|
+
|
|
20
|
+
import type { ContractName } from "../enum/contracts";
|
|
21
|
+
import type { TransactionActionType } from "../enum/txnEnum";
|
|
22
|
+
import type {
|
|
23
|
+
IUseContractWriteArgs,
|
|
24
|
+
TxnEventKeys,
|
|
25
|
+
} from "../hooks/useContractWrite/types";
|
|
26
|
+
|
|
27
|
+
export type DefaultHookOptions = SWRConfiguration & { isEnabled?: boolean };
|
|
28
|
+
|
|
29
|
+
export type DefaultHookReturnType<T = any> = BeraSwrResponse<T, any>;
|
|
30
|
+
|
|
31
|
+
export type IContractWriteFn = <
|
|
32
|
+
abi extends Abi | undefined = undefined,
|
|
33
|
+
functionName extends abi extends Abi
|
|
34
|
+
? ContractFunctionName<abi>
|
|
35
|
+
: never = abi extends Abi ? ContractFunctionName<abi> : never,
|
|
36
|
+
params extends abi extends Abi
|
|
37
|
+
? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName>
|
|
38
|
+
: never = abi extends Abi
|
|
39
|
+
? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName>
|
|
40
|
+
: never,
|
|
41
|
+
>(
|
|
42
|
+
props: IContractWrite<abi, functionName, params>,
|
|
43
|
+
) => Promise<
|
|
44
|
+
| TransactionReceipt
|
|
45
|
+
| WalletCallReceipt<bigint, "success" | "reverted">
|
|
46
|
+
| undefined
|
|
47
|
+
>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Posthog must be able to serialize this. BigInts are not supported.
|
|
51
|
+
*/
|
|
52
|
+
type AllowedEventData = number | string | boolean | null | undefined;
|
|
53
|
+
|
|
54
|
+
type EventData = Record<
|
|
55
|
+
string,
|
|
56
|
+
| AllowedEventData
|
|
57
|
+
| AllowedEventData[]
|
|
58
|
+
| Record<
|
|
59
|
+
string,
|
|
60
|
+
| AllowedEventData
|
|
61
|
+
| AllowedEventData[]
|
|
62
|
+
| Record<string, AllowedEventData | AllowedEventData[]>
|
|
63
|
+
>
|
|
64
|
+
>;
|
|
65
|
+
|
|
66
|
+
export type IContractWrite<
|
|
67
|
+
abi extends Abi | undefined = undefined,
|
|
68
|
+
functionName extends abi extends Abi
|
|
69
|
+
? ContractFunctionName<abi>
|
|
70
|
+
: never = abi extends Abi ? ContractFunctionName<abi> : never,
|
|
71
|
+
params extends abi extends Abi
|
|
72
|
+
? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName>
|
|
73
|
+
: never = abi extends Abi
|
|
74
|
+
? ContractFunctionArgs<abi, "payable" | "nonpayable", functionName>
|
|
75
|
+
: never,
|
|
76
|
+
> = {
|
|
77
|
+
/**
|
|
78
|
+
* A message that will be shown to user while the transaction is pending.
|
|
79
|
+
*
|
|
80
|
+
* @example "Sending approvals"
|
|
81
|
+
*/
|
|
82
|
+
message: string;
|
|
83
|
+
/**
|
|
84
|
+
* The chain ID of the transaction.
|
|
85
|
+
*
|
|
86
|
+
* @default berachainChainId
|
|
87
|
+
*/
|
|
88
|
+
chainId?: ChainId;
|
|
89
|
+
/**
|
|
90
|
+
* The type of transaction to be performed. It will be stored in the transaction history.
|
|
91
|
+
*
|
|
92
|
+
* Generally uses infinite tense.
|
|
93
|
+
* @example TransactionActionType.APPROVAL => "Approve tokens"
|
|
94
|
+
*/
|
|
95
|
+
actionType: TransactionActionType;
|
|
96
|
+
txnName?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Extra Sentry tags to attach to this transaction's scope, merged under the
|
|
99
|
+
* `operation.txn.*` namespace (e.g. `{ aggregator: "oogabooga" }` becomes the
|
|
100
|
+
* `operation.txn.aggregator` tag). Use for context that helps triage failures
|
|
101
|
+
* without decoding calldata.
|
|
102
|
+
*/
|
|
103
|
+
extraTags?: Record<string, string>;
|
|
104
|
+
gasLimit?: bigint;
|
|
105
|
+
account?: Account | Address;
|
|
106
|
+
/**
|
|
107
|
+
* Wheter the transaction can be sent by any account. Before setting this to true, make sure smart contract doesn't rely on `msg.sender`.
|
|
108
|
+
*
|
|
109
|
+
* Only transaction with permissionless flag set to true can be sent with overriden account.
|
|
110
|
+
* Everything else will throw an error.
|
|
111
|
+
*/
|
|
112
|
+
permissionless?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* The event to be tracked more specifically.
|
|
115
|
+
* If not provided, the event will be tracked with the message and actionType.
|
|
116
|
+
*/
|
|
117
|
+
track?: {
|
|
118
|
+
eventName: string;
|
|
119
|
+
eventData?: EventData;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* A wagmi config used to get wallet clients, switch chains, etc.
|
|
124
|
+
*
|
|
125
|
+
* This is preferred over providing clients as state updates are kept synched in this config object w/o re-rendering.
|
|
126
|
+
*/
|
|
127
|
+
wagmiConfig?: Config;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* walletClient should only be provided for tests or scripts.
|
|
131
|
+
*
|
|
132
|
+
* Wagmi Config is preferred.
|
|
133
|
+
*/
|
|
134
|
+
walletClient?: GetWalletClientReturnType | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* The name of the contract to be used for the transaction. By default, it will be devrel's contract mapping.
|
|
137
|
+
* Custom values will be ignored if the address is already mapped in the devrel's contract mapping.
|
|
138
|
+
*
|
|
139
|
+
* @example "pol.rewardVault"
|
|
140
|
+
*/
|
|
141
|
+
contractName?: ContractName;
|
|
142
|
+
/**
|
|
143
|
+
* This is a canonical list of ABIs that will be used to parse the error.
|
|
144
|
+
*
|
|
145
|
+
* This is an useful way to parse errors when providing raw data with no ABI.
|
|
146
|
+
*/
|
|
147
|
+
errorsAbi?: Abi;
|
|
148
|
+
} & IUseContractWriteArgs<abi, functionName, params> &
|
|
149
|
+
(abi extends Abi
|
|
150
|
+
? {
|
|
151
|
+
abi: abi;
|
|
152
|
+
functionName: functionName;
|
|
153
|
+
params: params;
|
|
154
|
+
address: Address;
|
|
155
|
+
calls?: never;
|
|
156
|
+
value?: bigint;
|
|
157
|
+
}
|
|
158
|
+
:
|
|
159
|
+
| {
|
|
160
|
+
data: Hex;
|
|
161
|
+
address: Address;
|
|
162
|
+
value?: bigint;
|
|
163
|
+
calls?: never;
|
|
164
|
+
}
|
|
165
|
+
| {
|
|
166
|
+
value: bigint;
|
|
167
|
+
address: Address;
|
|
168
|
+
data?: Hex;
|
|
169
|
+
calls?: never;
|
|
170
|
+
}
|
|
171
|
+
| {
|
|
172
|
+
value?: never;
|
|
173
|
+
address?: never;
|
|
174
|
+
calls: (Omit<
|
|
175
|
+
IContractWrite,
|
|
176
|
+
| "calls"
|
|
177
|
+
| "gasLimit"
|
|
178
|
+
| "account"
|
|
179
|
+
| "address"
|
|
180
|
+
| "message"
|
|
181
|
+
| "actionType"
|
|
182
|
+
| TxnEventKeys
|
|
183
|
+
> & {
|
|
184
|
+
address: Address;
|
|
185
|
+
})[];
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
declare global {
|
|
189
|
+
export namespace BeraJS {
|
|
190
|
+
export type BaseFunctionArgs = {
|
|
191
|
+
/**
|
|
192
|
+
* If only chainId is provided, config will be inferred from it
|
|
193
|
+
*
|
|
194
|
+
* @default `import { defaultChainId } from "@berachain/config/internal";`
|
|
195
|
+
*/
|
|
196
|
+
chainId?: ChainId;
|
|
197
|
+
/**
|
|
198
|
+
* A config to infer the default values of the other arguments
|
|
199
|
+
*
|
|
200
|
+
* @default chainConfigs[chainId]
|
|
201
|
+
*/
|
|
202
|
+
config?: BeraConfig;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|