@merkl/api 0.18.13 → 0.18.14
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/src/cache/index.d.ts +9 -0
- package/dist/src/cache/index.js +12 -3
- package/dist/src/eden/index.d.ts +25 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/xU308Processor.d.ts +2 -2
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/implementations/xU308Processor.js +9 -9
- package/dist/src/libs/staticCampaigns.d.ts +5 -0
- package/dist/src/libs/staticCampaigns.js +5 -0
- package/dist/src/modules/v4/claims/claims.service.js +1 -2
- package/dist/src/modules/v4/enso/enso.service.js +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +5 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +1 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.js +3 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +8 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +3 -9
- package/dist/src/modules/v4/router.d.ts +5 -0
- package/dist/src/modules/v4/status/status.service.js +4 -2
- package/dist/src/modules/v4/token/token.service.js +10 -1
- package/dist/src/utils/prices/priceService.js +1 -1
- package/dist/src/utils/prices/services/erc4626Service.js +1 -1
- package/dist/src/utils/throw.d.ts +18 -1
- package/dist/src/utils/throw.js +17 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/utils/throw.js
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
import { isSupportedChain } from "@sdk";
|
2
2
|
import { utils } from "ethers";
|
3
3
|
import { InvalidParameter, UnsupportedNetwork } from "./error";
|
4
|
+
/**
|
5
|
+
* Use this function to throw an error if the address is invalid
|
6
|
+
* and normalize the address to its checksum version
|
7
|
+
*
|
8
|
+
* @dev Usage: params.address = throwOnInvalidAddress(params.address);
|
9
|
+
*/
|
4
10
|
export const throwOnInvalidRequiredAddress = (address) => {
|
5
11
|
try {
|
6
12
|
if (!address)
|
@@ -11,6 +17,14 @@ export const throwOnInvalidRequiredAddress = (address) => {
|
|
11
17
|
throw new InvalidParameter(`Address ${address} is invalid`);
|
12
18
|
}
|
13
19
|
};
|
20
|
+
/**
|
21
|
+
* Use this function to throw an error if the address is invalid
|
22
|
+
* and normalize the address to its checksum version
|
23
|
+
*
|
24
|
+
* Address can be null or undefined
|
25
|
+
*
|
26
|
+
* @dev Usage: params.address = throwOnInvalidAddress(params.address);
|
27
|
+
*/
|
14
28
|
export const throwOnInvalidAddress = (address) => {
|
15
29
|
try {
|
16
30
|
if (!address)
|
@@ -21,6 +35,9 @@ export const throwOnInvalidAddress = (address) => {
|
|
21
35
|
throw new InvalidParameter(`Address ${address} is invalid`);
|
22
36
|
}
|
23
37
|
};
|
38
|
+
/**
|
39
|
+
* Use this function to throw an error if the chainId is not supported by Merkl
|
40
|
+
*/
|
24
41
|
export const throwOnUnsupportedChainId = (chainId) => {
|
25
42
|
if (chainId && !isSupportedChain(chainId, "merkl"))
|
26
43
|
throw new UnsupportedNetwork(chainId);
|