@huma-finance/sdk 0.0.18 → 0.0.19

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.
@@ -1,3 +1,4 @@
1
+ import { EAPayload, EAPreapprovalPayload } from '@huma-finance/shared';
1
2
  /**
2
3
  * Object representing the response to the underwriting approval request.
3
4
  * @typedef {Object} ApprovalResult
@@ -14,5 +15,6 @@ export type { ApprovalResult, EAPayload } from '@huma-finance/shared';
14
15
  * @namespace EAService
15
16
  */
16
17
  export declare const EAService: {
17
- approve: (payload: import("@huma-finance/shared").EAPayload, chainId: number, isDev?: boolean | undefined) => Promise<import("@huma-finance/shared").Approval>;
18
+ approve: (payload: EAPayload, chainId: number) => Promise<import("@huma-finance/shared").Approval>;
19
+ preapprove: (payload: EAPreapprovalPayload, chainId: number) => Promise<import("@huma-finance/shared").PreapprovalResult>;
18
20
  };
@@ -2,12 +2,35 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EAService = void 0;
4
4
  const shared_1 = require("@huma-finance/shared");
5
+ /**
6
+ * Submits a credit underwriting request to Huma's EAVerse. This approves a creditline
7
+ * in Huma's pools that can be drawn down by the borrower.
8
+ *
9
+ * @memberof EAService
10
+ * @param {EAPayload} payload The payload for the underwrite approval.
11
+ * @param {number} chainId The chain ID.
12
+ * @param {boolean} isDev Is dev environment or not.
13
+ * @returns {Promise<Approval>} Promise that returns the approval on success.
14
+ * @throws {EARejectionError} If the underwrite approval is rejected.
15
+ */
16
+ const approve = async (payload, chainId) => shared_1.EAService.approve(payload, chainId);
17
+ /**
18
+ * Checks whether or not a credit underwriting request to Huma's EAVerse would be approved.
19
+ * Note that this does not approve a creditline in Huma's pools and an approve call is still required.
20
+ *
21
+ * @param {EAPreapprovalPayload} payload The payload for the underwrite approval.
22
+ * @param {number} chainId The chain ID.
23
+ * @param {boolean} isDev Is dev environment or not.
24
+ * @returns {Promise<Approval>} Promise that returns the approval on success.
25
+ */
26
+ const preapprove = async (payload, chainId) => shared_1.EAService.preapprove(payload, chainId);
5
27
  /**
6
28
  * An object that contains functions to interact with Huma's EAVerse service.
7
29
  *
8
30
  * @namespace EAService
9
31
  */
10
32
  exports.EAService = {
11
- approve: shared_1.EAService.approve,
33
+ approve,
34
+ preapprove,
12
35
  };
13
36
  //# sourceMappingURL=EAService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EAService.js","sourceRoot":"","sources":["../../../src/services/EAService.ts"],"names":[],"mappings":";;;AAAA,iDAAqE;AAarE;;;;GAIG;AACU,QAAA,SAAS,GAAG;IACvB,OAAO,EAAE,kBAAiB,CAAC,OAAO;CACnC,CAAA"}
1
+ {"version":3,"file":"EAService.js","sourceRoot":"","sources":["../../../src/services/EAService.ts"],"names":[],"mappings":";;;AAAA,iDAI6B;AAa7B;;;;;;;;;;GAUG;AACH,MAAM,OAAO,GAAG,KAAK,EAAE,OAAkB,EAAE,OAAe,EAAE,EAAE,CAC5D,kBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAE7C;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,KAAK,EAAE,OAA6B,EAAE,OAAe,EAAE,EAAE,CAC1E,kBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAEhD;;;;GAIG;AACU,QAAA,SAAS,GAAG;IACvB,OAAO;IACP,UAAU;CACX,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { EAPayload, EAPreapprovalPayload } from '@huma-finance/shared';
1
2
  /**
2
3
  * Object representing the response to the underwriting approval request.
3
4
  * @typedef {Object} ApprovalResult
@@ -14,5 +15,6 @@ export type { ApprovalResult, EAPayload } from '@huma-finance/shared';
14
15
  * @namespace EAService
15
16
  */
16
17
  export declare const EAService: {
17
- approve: (payload: import("@huma-finance/shared").EAPayload, chainId: number, isDev?: boolean | undefined) => Promise<import("@huma-finance/shared").Approval>;
18
+ approve: (payload: EAPayload, chainId: number) => Promise<import("@huma-finance/shared").Approval>;
19
+ preapprove: (payload: EAPreapprovalPayload, chainId: number) => Promise<import("@huma-finance/shared").PreapprovalResult>;
18
20
  };
@@ -1,10 +1,33 @@
1
- import { EAService as EAServiceInternal } from '@huma-finance/shared';
1
+ import { EAService as EAServiceInternal, } from '@huma-finance/shared';
2
+ /**
3
+ * Submits a credit underwriting request to Huma's EAVerse. This approves a creditline
4
+ * in Huma's pools that can be drawn down by the borrower.
5
+ *
6
+ * @memberof EAService
7
+ * @param {EAPayload} payload The payload for the underwrite approval.
8
+ * @param {number} chainId The chain ID.
9
+ * @param {boolean} isDev Is dev environment or not.
10
+ * @returns {Promise<Approval>} Promise that returns the approval on success.
11
+ * @throws {EARejectionError} If the underwrite approval is rejected.
12
+ */
13
+ const approve = async (payload, chainId) => EAServiceInternal.approve(payload, chainId);
14
+ /**
15
+ * Checks whether or not a credit underwriting request to Huma's EAVerse would be approved.
16
+ * Note that this does not approve a creditline in Huma's pools and an approve call is still required.
17
+ *
18
+ * @param {EAPreapprovalPayload} payload The payload for the underwrite approval.
19
+ * @param {number} chainId The chain ID.
20
+ * @param {boolean} isDev Is dev environment or not.
21
+ * @returns {Promise<Approval>} Promise that returns the approval on success.
22
+ */
23
+ const preapprove = async (payload, chainId) => EAServiceInternal.preapprove(payload, chainId);
2
24
  /**
3
25
  * An object that contains functions to interact with Huma's EAVerse service.
4
26
  *
5
27
  * @namespace EAService
6
28
  */
7
29
  export const EAService = {
8
- approve: EAServiceInternal.approve,
30
+ approve,
31
+ preapprove,
9
32
  };
10
33
  //# sourceMappingURL=EAService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EAService.js","sourceRoot":"","sources":["../../src/services/EAService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAarE;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,iBAAiB,CAAC,OAAO;CACnC,CAAA"}
1
+ {"version":3,"file":"EAService.js","sourceRoot":"","sources":["../../src/services/EAService.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,IAAI,iBAAiB,GAC/B,MAAM,sBAAsB,CAAA;AAa7B;;;;;;;;;;GAUG;AACH,MAAM,OAAO,GAAG,KAAK,EAAE,OAAkB,EAAE,OAAe,EAAE,EAAE,CAC5D,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAE7C;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,KAAK,EAAE,OAA6B,EAAE,OAAe,EAAE,EAAE,CAC1E,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO;IACP,UAAU;CACX,CAAA"}