Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions js/packages/core/src/__tests__/smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ describe("Enums", () => {
expect(IDKitErrorCodes.CredentialUnavailable).toBe(
"credential_unavailable",
);
expect(IDKitErrorCodes.WorldId4NotAvailable).toBe(
"world_id_4_not_available",
);
expect(IDKitErrorCodes.WorldId3NotAvailable).toBe(
"world_id_3_not_available",
);
expect(IDKitErrorCodes.InvalidRpSignature).toBe("invalid_rp_signature");
expect(IDKitErrorCodes.NullifierReplayed).toBe("nullifier_replayed");
expect(IDKitErrorCodes.DuplicateNonce).toBe("duplicate_nonce");
Expand Down
2 changes: 2 additions & 0 deletions js/packages/core/src/types/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export enum IDKitErrorCodes {
UserRejected = "user_rejected",
VerificationRejected = "verification_rejected",
CredentialUnavailable = "credential_unavailable",
WorldId4NotAvailable = "world_id_4_not_available",
WorldId3NotAvailable = "world_id_3_not_available",
MalformedRequest = "malformed_request",
InvalidNetwork = "invalid_network",
InclusionProofPending = "inclusion_proof_pending",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ enum class IDKitErrorCode(val rawValue: String) {
USER_REJECTED("user_rejected"),
VERIFICATION_REJECTED("verification_rejected"),
CREDENTIAL_UNAVAILABLE("credential_unavailable"),
WORLD_ID_4_NOT_AVAILABLE("world_id_4_not_available"),
WORLD_ID_3_NOT_AVAILABLE("world_id_3_not_available"),
MALFORMED_REQUEST("malformed_request"),
INVALID_NETWORK("invalid_network"),
INCLUSION_PROOF_PENDING("inclusion_proof_pending"),
Expand All @@ -70,6 +72,8 @@ enum class IDKitErrorCode(val rawValue: String) {
AppError.USER_REJECTED -> USER_REJECTED
AppError.VERIFICATION_REJECTED -> VERIFICATION_REJECTED
AppError.CREDENTIAL_UNAVAILABLE -> CREDENTIAL_UNAVAILABLE
AppError.WORLD_ID4_NOT_AVAILABLE -> WORLD_ID_4_NOT_AVAILABLE
AppError.WORLD_ID3_NOT_AVAILABLE -> WORLD_ID_3_NOT_AVAILABLE
AppError.MALFORMED_REQUEST -> MALFORMED_REQUEST
AppError.INVALID_NETWORK -> INVALID_NETWORK
AppError.INCLUSION_PROOF_PENDING -> INCLUSION_PROOF_PENDING
Expand Down
2 changes: 2 additions & 0 deletions rust/core/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,8 @@ mod tests {
));

let cases = [
("world_id_4_not_available", AppError::WorldId4NotAvailable),
("world_id_3_not_available", AppError::WorldId3NotAvailable),
("duplicate_nonce", AppError::DuplicateNonce),
("unknown_rp", AppError::UnknownRp),
("inactive_rp", AppError::InactiveRp),
Expand Down
12 changes: 12 additions & 0 deletions rust/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ pub enum AppError {
#[error("Requested credential is not available")]
CredentialUnavailable,

/// World ID 4.0 credential is not available
#[error("World ID 4.0 is not available")]
#[serde(rename = "world_id_4_not_available")]
WorldId4NotAvailable,

/// World ID 3.0 credential is not available
#[error("World ID 3.0 is not available")]
#[serde(rename = "world_id_3_not_available")]
WorldId3NotAvailable,

/// Malformed request
#[error("Request is malformed")]
MalformedRequest,
Expand Down Expand Up @@ -158,6 +168,8 @@ impl AppError {
"user_rejected" => Self::UserRejected,
"verification_rejected" => Self::VerificationRejected,
"credential_unavailable" => Self::CredentialUnavailable,
"world_id_4_not_available" => Self::WorldId4NotAvailable,
"world_id_3_not_available" => Self::WorldId3NotAvailable,
"malformed_request" => Self::MalformedRequest,
"invalid_network" => Self::InvalidNetwork,
"inclusion_proof_pending" => Self::InclusionProofPending,
Expand Down
2 changes: 2 additions & 0 deletions rust/core/src/wasm_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,8 @@ export type IDKitErrorCode =
| "user_rejected"
| "verification_rejected"
| "credential_unavailable"
| "world_id_4_not_available"
| "world_id_3_not_available"
| "malformed_request"
| "invalid_network"
| "inclusion_proof_pending"
Expand Down
6 changes: 6 additions & 0 deletions swift/Sources/IDKit/IDKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public enum IDKitErrorCode: String, Equatable {
case userRejected = "user_rejected"
case verificationRejected = "verification_rejected"
case credentialUnavailable = "credential_unavailable"
case worldId4NotAvailable = "world_id_4_not_available"
case worldId3NotAvailable = "world_id_3_not_available"
case malformedRequest = "malformed_request"
case invalidNetwork = "invalid_network"
case inclusionProofPending = "inclusion_proof_pending"
Expand Down Expand Up @@ -118,6 +120,10 @@ public enum IDKitErrorCode: String, Equatable {
.verificationRejected
case .credentialUnavailable:
.credentialUnavailable
case .worldId4NotAvailable:
.worldId4NotAvailable
case .worldId3NotAvailable:
.worldId3NotAvailable
case .malformedRequest:
.malformedRequest
case .invalidNetwork:
Expand Down
Loading