diff --git a/js/packages/core/src/__tests__/smoke.test.ts b/js/packages/core/src/__tests__/smoke.test.ts index 7887abd7..39f75fc8 100644 --- a/js/packages/core/src/__tests__/smoke.test.ts +++ b/js/packages/core/src/__tests__/smoke.test.ts @@ -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"); diff --git a/js/packages/core/src/types/result.ts b/js/packages/core/src/types/result.ts index deb54858..a38c8336 100644 --- a/js/packages/core/src/types/result.ts +++ b/js/packages/core/src/types/result.ts @@ -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", diff --git a/kotlin/bindings/src/main/kotlin/com/worldcoin/idkit/IdKit.kt b/kotlin/bindings/src/main/kotlin/com/worldcoin/idkit/IdKit.kt index fe25fcee..a4927d2e 100644 --- a/kotlin/bindings/src/main/kotlin/com/worldcoin/idkit/IdKit.kt +++ b/kotlin/bindings/src/main/kotlin/com/worldcoin/idkit/IdKit.kt @@ -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"), @@ -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 diff --git a/rust/core/src/bridge.rs b/rust/core/src/bridge.rs index bc090fd1..5d4363a7 100644 --- a/rust/core/src/bridge.rs +++ b/rust/core/src/bridge.rs @@ -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), diff --git a/rust/core/src/error.rs b/rust/core/src/error.rs index a4285388..b11ad3be 100644 --- a/rust/core/src/error.rs +++ b/rust/core/src/error.rs @@ -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, @@ -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, diff --git a/rust/core/src/wasm_bindings.rs b/rust/core/src/wasm_bindings.rs index e11fa0d6..ac52f001 100644 --- a/rust/core/src/wasm_bindings.rs +++ b/rust/core/src/wasm_bindings.rs @@ -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" diff --git a/swift/Sources/IDKit/IDKit.swift b/swift/Sources/IDKit/IDKit.swift index 0f3d29cd..79d09a19 100644 --- a/swift/Sources/IDKit/IDKit.swift +++ b/swift/Sources/IDKit/IDKit.swift @@ -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" @@ -118,6 +120,10 @@ public enum IDKitErrorCode: String, Equatable { .verificationRejected case .credentialUnavailable: .credentialUnavailable + case .worldId4NotAvailable: + .worldId4NotAvailable + case .worldId3NotAvailable: + .worldId3NotAvailable case .malformedRequest: .malformedRequest case .invalidNetwork: