@celo/buy-identity 0.6.0 → 0.8.0
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/config.d.ts +10 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { SoftKycRequirements, VerificationRequest } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The Celo chain the Self hub for an endpoint type lives on. A `staging_*`
|
|
4
|
+
* endpoint registers mock identities on Celo Sepolia (11142220); a production
|
|
5
|
+
* one on Celo mainnet (42220). The SDK derives `chainID` from `staging_celo`
|
|
6
|
+
* ALONE, so a `staging_https` receiver silently gets 42220 and a mock passport,
|
|
7
|
+
* which registered on Sepolia, never matches: the Self app hangs at "Preparing
|
|
8
|
+
* for verification" and never posts. Setting it here removes that contradiction
|
|
9
|
+
* (celo-org/cpay#75).
|
|
10
|
+
*/
|
|
11
|
+
export declare function chainIdForEndpointType(endpointType: string | undefined): 11142220 | 42220;
|
|
2
12
|
/**
|
|
3
13
|
* Build a Self verification request and return the universal link the mobile
|
|
4
14
|
* app understands. The link is what gets rendered as a QR code in the terminal.
|
package/dist/index.js
CHANGED
|
@@ -24238,6 +24238,9 @@ function getUniversalLink(selfApp) {
|
|
|
24238
24238
|
}
|
|
24239
24239
|
|
|
24240
24240
|
// src/config.ts
|
|
24241
|
+
function chainIdForEndpointType(endpointType) {
|
|
24242
|
+
return endpointType?.startsWith("staging_") ? 11142220 : 42220;
|
|
24243
|
+
}
|
|
24241
24244
|
function toDisclosures(req) {
|
|
24242
24245
|
const disclosures = {};
|
|
24243
24246
|
if (req.minimumAge !== void 0) disclosures.minimumAge = req.minimumAge;
|
|
@@ -24254,6 +24257,9 @@ async function buildVerificationLink(request) {
|
|
|
24254
24257
|
scope: request.scope,
|
|
24255
24258
|
endpoint: request.endpoint,
|
|
24256
24259
|
endpointType: request.endpointType,
|
|
24260
|
+
// Derived from the endpoint type, not left to the SDK default, which maps
|
|
24261
|
+
// only `staging_celo` to Sepolia and sends `staging_https` to mainnet.
|
|
24262
|
+
chainID: chainIdForEndpointType(request.endpointType),
|
|
24257
24263
|
userId: request.userId,
|
|
24258
24264
|
userIdType: "hex",
|
|
24259
24265
|
userDefinedData: request.userDefinedData ?? "",
|
|
@@ -49055,6 +49061,7 @@ export {
|
|
|
49055
49061
|
attestationFetchMessage,
|
|
49056
49062
|
buildMockResult,
|
|
49057
49063
|
buildVerificationLink,
|
|
49064
|
+
chainIdForEndpointType,
|
|
49058
49065
|
createProofReceiver,
|
|
49059
49066
|
decodeUserDefinedData,
|
|
49060
49067
|
gatewayOriginFor,
|