@glowlabs-org/utils 0.2.148 → 0.2.150
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/cjs/browser.js +1 -1
- package/dist/cjs/constants/addresses.d.ts +1 -1
- package/dist/cjs/{farms-router-Cg0-zSMT.js → farms-router-CMpG0RGM.js} +29 -1
- package/dist/cjs/farms-router-CMpG0RGM.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/lib/control-api/region-router.d.ts +3 -1
- package/dist/cjs/lib/types/index.d.ts +47 -0
- package/dist/esm/browser.js +2 -2
- package/dist/esm/constants/addresses.d.ts +1 -1
- package/dist/esm/{farms-router-PZUo1LyW.js → farms-router-wk3VSuCV.js} +29 -1
- package/dist/esm/farms-router-wk3VSuCV.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/lib/control-api/region-router.d.ts +3 -1
- package/dist/esm/lib/types/index.d.ts +47 -0
- package/package.json +1 -1
- package/src/constants/addresses.ts +4 -1
- package/src/lib/control-api/region-router.ts +33 -0
- package/src/lib/hooks/use-offchain-fractions.ts +5 -0
- package/src/lib/types/index.ts +52 -0
- package/dist/cjs/farms-router-Cg0-zSMT.js.map +0 -1
- package/dist/esm/farms-router-PZUo1LyW.js.map +0 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type ContractKeys = "USDC" | "FORWARDER" | "FOUNDATION_WALLET" | "GLW" | "USDG" | "USDG_REDEMPTION" | "IMPACT_CATALYST" | "AUDIT_FEE_WALLET" | "UNISWAP_V2_ROUTER" | "UNISWAP_V2_FACTORY" | "USDG_UNISWAP" | "GLW_UNISWAP" | "OFFCHAIN_FRACTIONS" | "COUNTERFACTUAL_HOLDER_FACTORY" | "FOUNDATION_HUB_MANAGER_WALLET" | "FOUNDATION_REWARDS_WALLET" | "ENDOWMENT_WALLET";
|
|
1
|
+
export type ContractKeys = "USDC" | "FORWARDER" | "FOUNDATION_WALLET" | "GLW" | "USDG" | "USDG_REDEMPTION" | "IMPACT_CATALYST" | "AUDIT_FEE_WALLET" | "UNISWAP_V2_ROUTER" | "UNISWAP_V2_FACTORY" | "USDG_UNISWAP" | "GLW_UNISWAP" | "OFFCHAIN_FRACTIONS" | "COUNTERFACTUAL_HOLDER_FACTORY" | "FOUNDATION_HUB_MANAGER_WALLET" | "FOUNDATION_REWARDS_WALLET" | "ENDOWMENT_WALLET" | "REWARDS_KERNEL";
|
|
2
2
|
export declare const getAddresses: (CHAIN_ID: number) => Record<ContractKeys, `0x${string}`>;
|
|
3
3
|
export declare const DECIMALS_BY_TOKEN: Record<"USDC" | "USDG" | "GCTL" | "SGCTL" | "GLW", number>;
|
|
@@ -264,6 +264,7 @@ const mainnetAddresses = {
|
|
|
264
264
|
UNISWAP_V2_ROUTER: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
|
|
265
265
|
UNISWAP_V2_FACTORY: "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
|
|
266
266
|
ENDOWMENT_WALLET: "0x868D99B4a6e81b4683D10ea5665f13579A9d1607",
|
|
267
|
+
REWARDS_KERNEL: "0xd6d3139d40a32F8bA71D576c1A743529AB4786BB",
|
|
267
268
|
};
|
|
268
269
|
const sepoliaAddresses = {
|
|
269
270
|
AUDIT_FEE_WALLET: "0x3ff5af3333ddc6048d98849ec5e67868494693c9",
|
|
@@ -283,6 +284,7 @@ const sepoliaAddresses = {
|
|
|
283
284
|
UNISWAP_V2_ROUTER: "0xeE567Fe1712Faf6149d80dA1E6934E354124CfE3",
|
|
284
285
|
UNISWAP_V2_FACTORY: "0xF62c03E08ada871A0bEb309762E260a7a6a880E6",
|
|
285
286
|
ENDOWMENT_WALLET: "0x868D99B4a6e81b4683D10ea5665f13579A9d1607",
|
|
287
|
+
REWARDS_KERNEL: "0x92fcC4D8565062381d8fBD5Af1b32432104FDBC7",
|
|
286
288
|
};
|
|
287
289
|
const getAddresses = (CHAIN_ID) => {
|
|
288
290
|
switch (CHAIN_ID) {
|
|
@@ -1869,8 +1871,12 @@ function useOffchainFractions(walletClient, publicClient, CHAIN_ID) {
|
|
|
1869
1871
|
chainId: walletClient?.chain?.id,
|
|
1870
1872
|
contract: ADDRESSES.OFFCHAIN_FRACTIONS,
|
|
1871
1873
|
creator: params.creator,
|
|
1874
|
+
refundTo: params.refundTo,
|
|
1875
|
+
creditTo: params.creditTo,
|
|
1876
|
+
useCounterfactualAddressForRefund: params.useCounterfactualAddressForRefund,
|
|
1872
1877
|
id: params.id,
|
|
1873
1878
|
stepsToBuy: params.stepsToBuy.toString(),
|
|
1879
|
+
minStepsToBuy: params.minStepsToBuy.toString(),
|
|
1874
1880
|
});
|
|
1875
1881
|
throw new Error(parseViemError(error));
|
|
1876
1882
|
}
|
|
@@ -3781,6 +3787,26 @@ function RegionRouter(baseUrl) {
|
|
|
3781
3787
|
throw new Error(parseApiError$3(error));
|
|
3782
3788
|
}
|
|
3783
3789
|
};
|
|
3790
|
+
const fetchActiveSummary = async () => {
|
|
3791
|
+
try {
|
|
3792
|
+
return await request(`/regions/active/summary`);
|
|
3793
|
+
}
|
|
3794
|
+
catch (error) {
|
|
3795
|
+
throw new Error(parseApiError$3(error));
|
|
3796
|
+
}
|
|
3797
|
+
};
|
|
3798
|
+
const applyInstallerCertification = async (payload) => {
|
|
3799
|
+
try {
|
|
3800
|
+
return await request(`/regions/installers/apply`, {
|
|
3801
|
+
method: "POST",
|
|
3802
|
+
headers: { "Content-Type": "application/json" },
|
|
3803
|
+
body: JSON.stringify(payload),
|
|
3804
|
+
});
|
|
3805
|
+
}
|
|
3806
|
+
catch (error) {
|
|
3807
|
+
throw new Error(parseApiError$3(error));
|
|
3808
|
+
}
|
|
3809
|
+
};
|
|
3784
3810
|
// Kickstarter-related logic moved to kickstarter-router.ts
|
|
3785
3811
|
// -------------------------------------------------------------------------
|
|
3786
3812
|
// Helpers (derived)
|
|
@@ -3828,7 +3854,9 @@ function RegionRouter(baseUrl) {
|
|
|
3828
3854
|
fetchActivationEvents,
|
|
3829
3855
|
fetchRegionByIdOrSlug,
|
|
3830
3856
|
fetchRegionSolarFarms,
|
|
3857
|
+
fetchActiveSummary,
|
|
3831
3858
|
getRegionByCode,
|
|
3859
|
+
applyInstallerCertification,
|
|
3832
3860
|
// Cached data & flags
|
|
3833
3861
|
get regions() {
|
|
3834
3862
|
return cachedRegions;
|
|
@@ -4236,4 +4264,4 @@ exports.useForwarder = useForwarder;
|
|
|
4236
4264
|
exports.useOffchainFractions = useOffchainFractions;
|
|
4237
4265
|
exports.waitForEthersTransactionWithRetry = waitForEthersTransactionWithRetry;
|
|
4238
4266
|
exports.waitForViemTransactionWithRetry = waitForViemTransactionWithRetry;
|
|
4239
|
-
//# sourceMappingURL=farms-router-
|
|
4267
|
+
//# sourceMappingURL=farms-router-CMpG0RGM.js.map
|