@huma-finance/shared 0.0.59-beta.479 → 0.0.59-beta.481
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/hooks/useAuthErrorHandling.d.ts +3 -0
- package/dist/cjs/hooks/useAuthErrorHandling.js +10 -0
- package/dist/cjs/hooks/useAuthErrorHandling.js.map +1 -1
- package/dist/cjs/services/IdentityServiceV2.d.ts +55 -0
- package/dist/cjs/services/IdentityServiceV2.js +64 -0
- package/dist/cjs/services/IdentityServiceV2.js.map +1 -0
- package/dist/cjs/services/index.d.ts +1 -0
- package/dist/cjs/services/index.js +1 -0
- package/dist/cjs/services/index.js.map +1 -1
- package/dist/cjs/utils/chain.js +0 -2
- package/dist/cjs/utils/chain.js.map +1 -1
- package/dist/cjs/utils/request.js +1 -0
- package/dist/cjs/utils/request.js.map +1 -1
- package/dist/cjs/v2/metadata/alfajores.js +22 -1
- package/dist/cjs/v2/metadata/alfajores.js.map +1 -1
- package/dist/cjs/v2/metadata/baseSepolia.js +46 -25
- package/dist/cjs/v2/metadata/baseSepolia.js.map +1 -1
- package/dist/cjs/v2/metadata/humaTestnet.js +25 -24
- package/dist/cjs/v2/metadata/humaTestnet.js.map +1 -1
- package/dist/cjs/v2/utils/pool.d.ts +13 -6
- package/dist/cjs/v2/utils/pool.js.map +1 -1
- package/dist/hooks/useAuthErrorHandling.d.ts +3 -0
- package/dist/hooks/useAuthErrorHandling.js +10 -0
- package/dist/hooks/useAuthErrorHandling.js.map +1 -1
- package/dist/services/IdentityServiceV2.d.ts +55 -0
- package/dist/services/IdentityServiceV2.js +61 -0
- package/dist/services/IdentityServiceV2.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/utils/chain.js +0 -2
- package/dist/utils/chain.js.map +1 -1
- package/dist/utils/request.js +1 -0
- package/dist/utils/request.js.map +1 -1
- package/dist/v2/metadata/alfajores.js +22 -1
- package/dist/v2/metadata/alfajores.js.map +1 -1
- package/dist/v2/metadata/baseSepolia.js +46 -25
- package/dist/v2/metadata/baseSepolia.js.map +1 -1
- package/dist/v2/metadata/humaTestnet.js +25 -24
- package/dist/v2/metadata/humaTestnet.js.map +1 -1
- package/dist/v2/utils/pool.d.ts +13 -6
- package/dist/v2/utils/pool.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the identity status V2.
|
|
3
|
+
* @typedef {Enum} IdentityVerificationStatusV2
|
|
4
|
+
*/
|
|
5
|
+
export declare enum IdentityVerificationStatusV2 {
|
|
6
|
+
NOT_STARTED = "not_started",
|
|
7
|
+
CREATED = "created",
|
|
8
|
+
PENDING = "pending",
|
|
9
|
+
EXPIRED = "expired",
|
|
10
|
+
APPROVED = "approved",
|
|
11
|
+
DECLINED = "declined",
|
|
12
|
+
NEEDS_REVIEW = "needs_review"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Object representing the response to the identity verification status request.
|
|
16
|
+
* @typedef {Object} VerificationStatusResultV2
|
|
17
|
+
* @property {string} walletAddress the wallet address to get the verification status.
|
|
18
|
+
* @property {IdentityVerificationStatusV2} status The wallet's identity verification status.
|
|
19
|
+
* @property {string} personaInquiryId The persona inquiry id.
|
|
20
|
+
*/
|
|
21
|
+
export type VerificationStatusResultV2 = {
|
|
22
|
+
walletAddress: string;
|
|
23
|
+
status: IdentityVerificationStatusV2;
|
|
24
|
+
personaInquiryId: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Object representing the response to the identity verification status request.
|
|
28
|
+
* @typedef {Object} StartVerificationResultV2
|
|
29
|
+
* @property {string} walletAddress the wallet address to get the verification status.
|
|
30
|
+
* @property {IdentityVerificationStatusV2} status The wallet's identity verification status.
|
|
31
|
+
* @property {string} personaInquiryId The persona inquiry id.
|
|
32
|
+
*/
|
|
33
|
+
export type StartVerificationResultV2 = {
|
|
34
|
+
walletAddress: string;
|
|
35
|
+
status: IdentityVerificationStatusV2;
|
|
36
|
+
personaInquiryId: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Object representing the response to the identity verification resume request.
|
|
40
|
+
* @typedef {Object} StartVerificationResultV2
|
|
41
|
+
* @property {string} walletAddress The wallet address to resume the verification.
|
|
42
|
+
* @property {string} sessionToken The session token.
|
|
43
|
+
* @property {IdentityVerificationStatusV2} status The wallet's identity verification status.
|
|
44
|
+
*/
|
|
45
|
+
export type ResumeVerificationResultV2 = {
|
|
46
|
+
walletAddress: string;
|
|
47
|
+
sessionToken: string;
|
|
48
|
+
status: IdentityVerificationStatusV2;
|
|
49
|
+
};
|
|
50
|
+
export declare const IdentityServiceV2: {
|
|
51
|
+
getVerificationStatusV2: (walletAddress: string, chainId: number, isDev?: boolean) => Promise<VerificationStatusResultV2>;
|
|
52
|
+
startVerification: (walletAddress: string, chainId: number, isDev?: boolean) => Promise<VerificationStatusResultV2>;
|
|
53
|
+
resumeVerification: (walletAddress: string, chainId: number, isDev?: boolean) => Promise<ResumeVerificationResultV2>;
|
|
54
|
+
approveLender: (walletAddress: string, chainId: number, contractAddress: string, isDev?: boolean) => Promise<void>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { configUtil } from '../utils/config';
|
|
2
|
+
import { requestGet, requestPost } from '../utils/request';
|
|
3
|
+
/**
|
|
4
|
+
* Enum representing the identity status V2.
|
|
5
|
+
* @typedef {Enum} IdentityVerificationStatusV2
|
|
6
|
+
*/
|
|
7
|
+
export var IdentityVerificationStatusV2;
|
|
8
|
+
(function (IdentityVerificationStatusV2) {
|
|
9
|
+
IdentityVerificationStatusV2["NOT_STARTED"] = "not_started";
|
|
10
|
+
IdentityVerificationStatusV2["CREATED"] = "created";
|
|
11
|
+
IdentityVerificationStatusV2["PENDING"] = "pending";
|
|
12
|
+
IdentityVerificationStatusV2["EXPIRED"] = "expired";
|
|
13
|
+
IdentityVerificationStatusV2["APPROVED"] = "approved";
|
|
14
|
+
IdentityVerificationStatusV2["DECLINED"] = "declined";
|
|
15
|
+
IdentityVerificationStatusV2["NEEDS_REVIEW"] = "needs_review";
|
|
16
|
+
})(IdentityVerificationStatusV2 || (IdentityVerificationStatusV2 = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Get wallet's identity verification status.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} walletAddress The wallet address.
|
|
21
|
+
* @param {string} pool The pool address.
|
|
22
|
+
* @param {number} chainId Chain ID.
|
|
23
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
24
|
+
* @returns {Promise<VerificationStatusResultV2>} Promise that returns the verification status result.
|
|
25
|
+
*/
|
|
26
|
+
const getVerificationStatusV2 = async (walletAddress, chainId, isDev = false) => requestGet(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/verification-status?&chainId=${chainId}`);
|
|
27
|
+
/**
|
|
28
|
+
* Start wallet's verification process.
|
|
29
|
+
*
|
|
30
|
+
* @param {string} walletAddress The wallet address.
|
|
31
|
+
* @param {number} chainId Chain ID.
|
|
32
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
33
|
+
* @returns {Promise<VerificationStatusResultV2>} Promise that returns the start verification result.
|
|
34
|
+
*/
|
|
35
|
+
const startVerification = async (walletAddress, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/start-verification?chainId=${chainId}`);
|
|
36
|
+
/**
|
|
37
|
+
* Resume wallet's verification process.
|
|
38
|
+
*
|
|
39
|
+
* @param {string} walletAddress The wallet address.
|
|
40
|
+
* @param {number} chainId Chain ID.
|
|
41
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
42
|
+
* @returns {Promise<ResumeVerificationResultV2>} Promise that returns the start verification result.
|
|
43
|
+
*/
|
|
44
|
+
const resumeVerification = async (walletAddress, chainId, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/resume-verification?chainId=${chainId}`);
|
|
45
|
+
/**
|
|
46
|
+
* Approve wallet as lender.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} walletAddress The wallet address.
|
|
49
|
+
* @param {number} chainId Chain ID.
|
|
50
|
+
* @param {string} contractAddress The tranche vault contract address.
|
|
51
|
+
* @param {boolean} isDev Is dev environment or not.
|
|
52
|
+
* @returns {Promise<void>} Promise that returns void.
|
|
53
|
+
*/
|
|
54
|
+
const approveLender = async (walletAddress, chainId, contractAddress, isDev = false) => requestPost(`${configUtil.getIdentityAPIUrl(chainId, isDev)}/wallets/${walletAddress}/approve-lender?chainId=${chainId}&contractAddress=${contractAddress}`);
|
|
55
|
+
export const IdentityServiceV2 = {
|
|
56
|
+
getVerificationStatusV2,
|
|
57
|
+
startVerification,
|
|
58
|
+
resumeVerification,
|
|
59
|
+
approveLender,
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=IdentityServiceV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityServiceV2.js","sourceRoot":"","sources":["../../src/services/IdentityServiceV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE1D;;;GAGG;AACH,MAAM,CAAN,IAAY,4BAQX;AARD,WAAY,4BAA4B;IACtC,2DAA2B,CAAA;IAC3B,mDAAmB,CAAA;IACnB,mDAAmB,CAAA;IACnB,mDAAmB,CAAA;IACnB,qDAAqB,CAAA;IACrB,qDAAqB,CAAA;IACrB,6DAA6B,CAAA;AAC/B,CAAC,EARW,4BAA4B,KAA5B,4BAA4B,QAQvC;AAeD;;;;;;;;GAQG;AACH,MAAM,uBAAuB,GAAG,KAAK,EACnC,aAAqB,EACrB,OAAe,EACf,KAAK,GAAG,KAAK,EACwB,EAAE,CACvC,UAAU,CACR,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,YAAY,aAAa,iCAAiC,OAAO,EAAE,CACrE,CAAA;AAeH;;;;;;;GAOG;AACH,MAAM,iBAAiB,GAAG,KAAK,EAC7B,aAAqB,EACrB,OAAe,EACf,KAAK,GAAG,KAAK,EACwB,EAAE,CACvC,WAAW,CACT,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,YAAY,aAAa,+BAA+B,OAAO,EAAE,CACnE,CAAA;AAeH;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,KAAK,EAC9B,aAAqB,EACrB,OAAe,EACf,KAAK,GAAG,KAAK,EACwB,EAAE,CACvC,WAAW,CACT,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,YAAY,aAAa,gCAAgC,OAAO,EAAE,CACpE,CAAA;AAEH;;;;;;;;GAQG;AACH,MAAM,aAAa,GAAG,KAAK,EACzB,aAAqB,EACrB,OAAe,EACf,eAAuB,EACvB,KAAK,GAAG,KAAK,EACE,EAAE,CACjB,WAAW,CACT,GAAG,UAAU,CAAC,iBAAiB,CAC7B,OAAO,EACP,KAAK,CACN,YAAY,aAAa,2BAA2B,OAAO,oBAAoB,eAAe,EAAE,CAClG,CAAA;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,uBAAuB;IACvB,iBAAiB;IACjB,kBAAkB;IAClB,aAAa;CACd,CAAA"}
|
package/dist/services/index.d.ts
CHANGED
package/dist/services/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA"}
|