@kingdomchain/wallet-client 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/attestation.ts","../src/generated/google/protobuf/timestamp.ts","../src/generated/isatheword/kingdomchain/citizen/v1/tx.ts","../src/generated/isatheword/kingdomchain/compliance/v1/tx.ts","../src/generated/isatheword/kingdomchain/compliance/v1/compliance.ts","../src/registry.ts","../src/chainConstants.ts","../src/browserSigner.ts","../src/submitApplication.ts"],"names":["BinaryWriter","BinaryReader","toTimestamp","fromTimestamp","ApplicationStatus","RecoveryAttestationStatus"],"mappings":";;;;;;;;AAKO,IAAM,wCAAA,GAA2C;AAGjD,IAAM,yBAAA,GAA4B;AAmBzC,SAAS,UAAU,KAAA,EAA2B;AAC5C,EAAA,OAAO,OAAO,IAAI,WAAA,EAAY,CAAE,MAAA,CAAO,KAAK,CAAC,CAAA;AAC/C;AAGA,SAAS,YAAA,CAAa,OAAe,SAAA,EAA2B;AAC9D,EAAA,IAAI,QAAQ,EAAA,EAAI;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,SAAS,CAAA,2BAAA,EAA8B,KAAK,CAAA,CAAE,CAAA;AAAA,EACnE;AACA,EAAA,IAAI,QAAQ,mBAAA,EAAwB;AAClC,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,SAAS,CAAA,yBAAA,EAA4B,KAAK,CAAA,CAAE,CAAA;AAAA,EACjE;AACA,EAAA,OAAO,KAAA,CAAM,SAAS,EAAE,CAAA;AAC1B;AAGA,SAAS,YAAY,IAAA,EAAoB;AACvC,EAAA,OAAO,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,OAAA,KAAY,GAAI,CAAA;AACzC;AAEA,SAAS,cAAc,MAAA,EAA8B;AACnD,EAAA,MAAM,QAAA,GAAW,OAAO,MAAA,CAAO,CAAC,KAAK,CAAA,KAAM,GAAA,GAAM,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GACH;AACF;AAEA,eAAsB,2BACpB,MAAA,EACgE;AAChE,EAAA,MAAM,KAAA,GAAiC;AAAA,IACrC,eAAA,EAAiB,wCAAA;AAAA,IACjB,SAAS,MAAA,CAAO,OAAA;AAAA,IAChB,gBAAgB,MAAA,CAAO,eAAA;AAAA,IACvB,QAAQ,MAAA,CAAO,aAAA;AAAA,IACf,eAAe,MAAA,CAAO,aAAA;AAAA,IACtB,OAAO,MAAA,CAAO,KAAA;AAAA,IACd,qBAAqB,MAAA,CAAO,mBAAA;AAAA,IAC5B,UAAU,MAAA,CAAO,QAAA;AAAA,IACjB,WAAW,MAAA,CAAO,SAAA;AAAA,IAClB,YAAY,MAAA,CAAO,UAAA;AAAA,IACnB,kBAAA,EAAoB,OAAO,kBAAA,IAAsB;AAAA,GACnD;AACA,EAAA,MAAM,OAAA,GAAU,uBAAuB,KAAK,CAAA;AAC5C,EAAA,MAAM,YAAA,GAAe,mBAAA,CAAoB,MAAA,CAAO,eAAe,CAAA;AAC/D,EAAA,MAAM,SAAA,GAAY,MAAM,sBAAA,CAAuB,YAAA,EAAc,OAAO,CAAA;AACpE,EAAA,OAAO,EAAE,WAAW,KAAA,EAAM;AAC5B","file":"index.js","sourcesContent":["import { fromHex, toHex } from \"@cosmjs/encoding\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport * as ed from \"@noble/ed25519\";\n\n/** Must match x/compliance/types/keys.go AttestationTypeCitizenshipApplication */\nexport const ATTESTATION_TYPE_CITIZENSHIP_APPLICATION = \"citizenship_application\";\n\n/** Must match x/compliance/types/keys.go AttestationTypeRecovery */\nexport const ATTESTATION_TYPE_RECOVERY = \"recovery\";\n\nexport interface AttestationPayloadInput {\n attestationType: string;\n chainId: string;\n intendedWallet: string;\n caseId: string;\n policyVersion: string;\n nonce: string;\n uniquenessReference: string;\n issuedAt: Date;\n expiresAt: Date;\n providerId: string;\n providerKeyVersion: bigint;\n citizenId?: bigint;\n oldWallet?: string;\n newWallet?: string;\n}\n\nfunction hashField(value: string): Uint8Array {\n return sha256(new TextEncoder().encode(value));\n}\n\n/** Format uint64 the same way Go strconv.FormatUint(v, 10) does. Rejects out-of-range values. */\nfunction formatUint64(value: bigint, fieldName: string): string {\n if (value < 0n) {\n throw new Error(`${fieldName} must be non-negative, got ${value}`);\n }\n if (value > 0xffff_ffff_ffff_ffffn) {\n throw new Error(`${fieldName} exceeds uint64 max, got ${value}`);\n }\n return value.toString(10);\n}\n\n/** Unix seconds truncated toward zero — matches Go time.Time.Unix(). */\nfunction unixSeconds(date: Date): number {\n return Math.trunc(date.getTime() / 1000);\n}\n\nfunction combineHashes(hashes: Uint8Array[]): string {\n const totalLen = hashes.reduce((acc, h) => acc + h.length, 0);\n const preimage = new Uint8Array(totalLen);\n let offset = 0;\n for (const h of hashes) {\n preimage.set(h, offset);\n offset += h.length;\n }\n return toHex(sha256(preimage));\n}\n\n/**\n * Canonical attestation payload — must match Go types.AttestationSignPayload bit-for-bit.\n */\nexport function attestationSignPayload(input: AttestationPayloadInput): string {\n const hashes = [\n hashField(input.attestationType),\n hashField(input.chainId),\n hashField(input.intendedWallet),\n hashField(input.caseId),\n hashField(input.policyVersion),\n hashField(input.nonce),\n hashField(input.uniquenessReference),\n hashField(String(unixSeconds(input.issuedAt))),\n hashField(String(unixSeconds(input.expiresAt))),\n hashField(input.providerId),\n hashField(formatUint64(input.providerKeyVersion, \"providerKeyVersion\")),\n ];\n if (input.attestationType === ATTESTATION_TYPE_RECOVERY) {\n hashes.push(\n hashField(formatUint64(input.citizenId ?? 0n, \"citizenId\")),\n hashField(input.oldWallet ?? \"\"),\n hashField(input.newWallet ?? \"\"),\n );\n }\n return combineHashes(hashes);\n}\n\nexport async function signAttestationPayload(privateKeySeed: Uint8Array, payload: string): Promise<string> {\n if (privateKeySeed.length !== 32) {\n throw new Error(\"invalid ed25519 seed size\");\n }\n const sig = await ed.signAsync(new TextEncoder().encode(payload), privateKeySeed);\n return toHex(sig);\n}\n\nexport async function publicKeyFromPrivateSeed(privateKeySeed: Uint8Array): Promise<string> {\n if (privateKeySeed.length !== 32) {\n throw new Error(\"invalid ed25519 seed size\");\n }\n const pub = await ed.getPublicKeyAsync(privateKeySeed);\n return toHex(pub);\n}\n\nexport function providerSeedFromHex(hex: string): Uint8Array {\n const seed = fromHex(hex);\n if (seed.length !== 32) {\n throw new Error(\"provider seed hex must decode to 32 bytes\");\n }\n return new Uint8Array(seed);\n}\n","// Code generated by protoc-gen-ts_proto. DO NOT EDIT.\n// versions:\n// protoc-gen-ts_proto v2.12.0\n// protoc unknown\n// source: google/protobuf/timestamp.proto\n\n/* eslint-disable */\nimport { BinaryReader, BinaryWriter } from \"@bufbuild/protobuf/wire\";\n\n/**\n * A Timestamp represents a point in time independent of any time zone or local\n * calendar, encoded as a count of seconds and fractions of seconds at\n * nanosecond resolution. The count is relative to an epoch at UTC midnight on\n * January 1, 1970, in the proleptic Gregorian calendar which extends the\n * Gregorian calendar backwards to year one.\n *\n * All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n * second table is needed for interpretation, using a [24-hour linear\n * smear](https://developers.google.com/time/smear).\n *\n * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n * restricting to that range, we ensure that we can convert to and from [RFC\n * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n *\n * # Examples\n *\n * Example 1: Compute Timestamp from POSIX `time()`.\n *\n * Timestamp timestamp;\n * timestamp.set_seconds(time(NULL));\n * timestamp.set_nanos(0);\n *\n * Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n *\n * struct timeval tv;\n * gettimeofday(&tv, NULL);\n *\n * Timestamp timestamp;\n * timestamp.set_seconds(tv.tv_sec);\n * timestamp.set_nanos(tv.tv_usec * 1000);\n *\n * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n *\n * FILETIME ft;\n * GetSystemTimeAsFileTime(&ft);\n * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n *\n * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n * Timestamp timestamp;\n * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n *\n * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n *\n * long millis = System.currentTimeMillis();\n *\n * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n * .setNanos((int) ((millis % 1000) * 1000000)).build();\n *\n * Example 5: Compute Timestamp from Java `Instant.now()`.\n *\n * Instant now = Instant.now();\n *\n * Timestamp timestamp =\n * Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n * .setNanos(now.getNano()).build();\n *\n * Example 6: Compute Timestamp from current time in Python.\n *\n * timestamp = Timestamp()\n * timestamp.GetCurrentTime()\n *\n * # JSON Mapping\n *\n * In JSON format, the Timestamp type is encoded as a string in the\n * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n * format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n * where {year} is always expressed using four digits while {month}, {day},\n * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n * are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n * is required. A proto3 JSON serializer should always use UTC (as indicated by\n * \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n * able to accept both UTC and other timezones (as indicated by an offset).\n *\n * For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n * 01:30 UTC on January 15, 2017.\n *\n * In JavaScript, one can convert a Date object to this format using the\n * standard\n * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n * method. In Python, a standard `datetime.datetime` object can be converted\n * to this format using\n * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use\n * the Joda Time's [`ISODateTimeFormat.dateTime()`](\n * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()\n * ) to obtain a formatter capable of generating timestamps in this format.\n */\nexport interface Timestamp {\n /**\n * Represents seconds of UTC time since Unix epoch\n * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n * 9999-12-31T23:59:59Z inclusive.\n */\n seconds: bigint;\n /**\n * Non-negative fractions of a second at nanosecond resolution. Negative\n * second values with fractions must still have non-negative nanos values\n * that count forward in time. Must be from 0 to 999,999,999\n * inclusive.\n */\n nanos: number;\n}\n\nfunction createBaseTimestamp(): Timestamp {\n return { seconds: 0n, nanos: 0 };\n}\n\nexport const Timestamp: MessageFns<Timestamp> = {\n encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.seconds !== 0n) {\n if (BigInt.asIntN(64, message.seconds) !== message.seconds) {\n throw new globalThis.Error(\"value provided for field message.seconds of type int64 too large\");\n }\n writer.uint32(8).int64(message.seconds);\n }\n if (message.nanos !== 0) {\n writer.uint32(16).int32(message.nanos);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Timestamp {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseTimestamp();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.seconds = reader.int64() as bigint;\n continue;\n }\n case 2: {\n if (tag !== 16) {\n break;\n }\n\n message.nanos = reader.int32();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<Timestamp>): Timestamp {\n return Timestamp.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<Timestamp>): Timestamp {\n const message = createBaseTimestamp();\n message.seconds = (object.seconds !== undefined && object.seconds !== null) ? BigInt(object.seconds) : 0n;\n message.nanos = object.nanos ?? 0;\n return message;\n },\n};\n\ntype Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;\n\ntype DeepPartial<T> = T extends bigint ? string | number | bigint\n : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>\n : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>\n : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }\n : Partial<T>;\n\ninterface MessageFns<T> {\n encode(message: T, writer?: BinaryWriter): BinaryWriter;\n decode(input: BinaryReader | Uint8Array, length?: number): T;\n create(base?: DeepPartial<T>): T;\n fromPartial(object: DeepPartial<T>): T;\n}\n","// Code generated by protoc-gen-ts_proto. DO NOT EDIT.\n// versions:\n// protoc-gen-ts_proto v2.12.0\n// protoc unknown\n// source: isatheword/kingdomchain/citizen/v1/tx.proto\n\n/* eslint-disable */\nimport { BinaryReader, BinaryWriter } from \"@bufbuild/protobuf/wire\";\nimport { Timestamp } from \"../../../../google/protobuf/timestamp\";\n\nexport interface MsgIssueKCP {\n authority: string;\n application_id: string;\n wallet_address: string;\n uniqueness_commitment: string;\n decision_id: string;\n}\n\nexport interface MsgIssueKCPResponse {\n citizen_id: bigint;\n}\n\nexport interface MsgSuspendKCP {\n authority: string;\n citizen_id: bigint;\n reason_code: string;\n expires_at?: Date | undefined;\n}\n\nexport interface MsgSuspendKCPResponse {\n}\n\nexport interface MsgReactivateKCP {\n authority: string;\n citizen_id: bigint;\n}\n\nexport interface MsgReactivateKCPResponse {\n}\n\nexport interface MsgRevokeKCP {\n authority: string;\n citizen_id: bigint;\n reason_code: string;\n evidence_ref: string;\n}\n\nexport interface MsgRevokeKCPResponse {\n}\n\nexport interface MsgInitiateRecovery {\n authority: string;\n citizen_id: bigint;\n new_wallet: string;\n recovery_case_id: string;\n cooling_off_ends_at?: Date | undefined;\n}\n\nexport interface MsgInitiateRecoveryResponse {\n}\n\nexport interface MsgApproveRecovery {\n authority: string;\n recovery_case_id: string;\n}\n\nexport interface MsgApproveRecoveryResponse {\n}\n\nexport interface MsgFinalizeRecovery {\n authority: string;\n recovery_case_id: string;\n decision_id: string;\n}\n\nexport interface MsgFinalizeRecoveryResponse {\n}\n\nexport interface MsgCancelRecovery {\n authority: string;\n recovery_case_id: string;\n reason_code: string;\n}\n\nexport interface MsgCancelRecoveryResponse {\n}\n\nfunction createBaseMsgIssueKCP(): MsgIssueKCP {\n return { authority: \"\", application_id: \"\", wallet_address: \"\", uniqueness_commitment: \"\", decision_id: \"\" };\n}\n\nexport const MsgIssueKCP: MessageFns<MsgIssueKCP> = {\n encode(message: MsgIssueKCP, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.application_id !== \"\") {\n writer.uint32(18).string(message.application_id);\n }\n if (message.wallet_address !== \"\") {\n writer.uint32(26).string(message.wallet_address);\n }\n if (message.uniqueness_commitment !== \"\") {\n writer.uint32(34).string(message.uniqueness_commitment);\n }\n if (message.decision_id !== \"\") {\n writer.uint32(42).string(message.decision_id);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgIssueKCP {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgIssueKCP();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.application_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.wallet_address = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.uniqueness_commitment = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.decision_id = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgIssueKCP>): MsgIssueKCP {\n return MsgIssueKCP.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgIssueKCP>): MsgIssueKCP {\n const message = createBaseMsgIssueKCP();\n message.authority = object.authority ?? \"\";\n message.application_id = object.application_id ?? \"\";\n message.wallet_address = object.wallet_address ?? \"\";\n message.uniqueness_commitment = object.uniqueness_commitment ?? \"\";\n message.decision_id = object.decision_id ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgIssueKCPResponse(): MsgIssueKCPResponse {\n return { citizen_id: 0n };\n}\n\nexport const MsgIssueKCPResponse: MessageFns<MsgIssueKCPResponse> = {\n encode(message: MsgIssueKCPResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.citizen_id !== 0n) {\n if (BigInt.asUintN(64, message.citizen_id) !== message.citizen_id) {\n throw new globalThis.Error(\"value provided for field message.citizen_id of type uint64 too large\");\n }\n writer.uint32(8).uint64(message.citizen_id);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgIssueKCPResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgIssueKCPResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 8) {\n break;\n }\n\n message.citizen_id = reader.uint64() as bigint;\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgIssueKCPResponse>): MsgIssueKCPResponse {\n return MsgIssueKCPResponse.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgIssueKCPResponse>): MsgIssueKCPResponse {\n const message = createBaseMsgIssueKCPResponse();\n message.citizen_id = (object.citizen_id !== undefined && object.citizen_id !== null)\n ? BigInt(object.citizen_id)\n : 0n;\n return message;\n },\n};\n\nfunction createBaseMsgSuspendKCP(): MsgSuspendKCP {\n return { authority: \"\", citizen_id: 0n, reason_code: \"\", expires_at: undefined };\n}\n\nexport const MsgSuspendKCP: MessageFns<MsgSuspendKCP> = {\n encode(message: MsgSuspendKCP, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.citizen_id !== 0n) {\n if (BigInt.asUintN(64, message.citizen_id) !== message.citizen_id) {\n throw new globalThis.Error(\"value provided for field message.citizen_id of type uint64 too large\");\n }\n writer.uint32(16).uint64(message.citizen_id);\n }\n if (message.reason_code !== \"\") {\n writer.uint32(26).string(message.reason_code);\n }\n if (message.expires_at !== undefined) {\n Timestamp.encode(toTimestamp(message.expires_at), writer.uint32(34).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgSuspendKCP {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgSuspendKCP();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 16) {\n break;\n }\n\n message.citizen_id = reader.uint64() as bigint;\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.reason_code = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.expires_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgSuspendKCP>): MsgSuspendKCP {\n return MsgSuspendKCP.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgSuspendKCP>): MsgSuspendKCP {\n const message = createBaseMsgSuspendKCP();\n message.authority = object.authority ?? \"\";\n message.citizen_id = (object.citizen_id !== undefined && object.citizen_id !== null)\n ? BigInt(object.citizen_id)\n : 0n;\n message.reason_code = object.reason_code ?? \"\";\n message.expires_at = object.expires_at ?? undefined;\n return message;\n },\n};\n\nfunction createBaseMsgSuspendKCPResponse(): MsgSuspendKCPResponse {\n return {};\n}\n\nexport const MsgSuspendKCPResponse: MessageFns<MsgSuspendKCPResponse> = {\n encode(_: MsgSuspendKCPResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgSuspendKCPResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgSuspendKCPResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgSuspendKCPResponse>): MsgSuspendKCPResponse {\n return MsgSuspendKCPResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgSuspendKCPResponse>): MsgSuspendKCPResponse {\n const message = createBaseMsgSuspendKCPResponse();\n return message;\n },\n};\n\nfunction createBaseMsgReactivateKCP(): MsgReactivateKCP {\n return { authority: \"\", citizen_id: 0n };\n}\n\nexport const MsgReactivateKCP: MessageFns<MsgReactivateKCP> = {\n encode(message: MsgReactivateKCP, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.citizen_id !== 0n) {\n if (BigInt.asUintN(64, message.citizen_id) !== message.citizen_id) {\n throw new globalThis.Error(\"value provided for field message.citizen_id of type uint64 too large\");\n }\n writer.uint32(16).uint64(message.citizen_id);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgReactivateKCP {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgReactivateKCP();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 16) {\n break;\n }\n\n message.citizen_id = reader.uint64() as bigint;\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgReactivateKCP>): MsgReactivateKCP {\n return MsgReactivateKCP.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgReactivateKCP>): MsgReactivateKCP {\n const message = createBaseMsgReactivateKCP();\n message.authority = object.authority ?? \"\";\n message.citizen_id = (object.citizen_id !== undefined && object.citizen_id !== null)\n ? BigInt(object.citizen_id)\n : 0n;\n return message;\n },\n};\n\nfunction createBaseMsgReactivateKCPResponse(): MsgReactivateKCPResponse {\n return {};\n}\n\nexport const MsgReactivateKCPResponse: MessageFns<MsgReactivateKCPResponse> = {\n encode(_: MsgReactivateKCPResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgReactivateKCPResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgReactivateKCPResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgReactivateKCPResponse>): MsgReactivateKCPResponse {\n return MsgReactivateKCPResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgReactivateKCPResponse>): MsgReactivateKCPResponse {\n const message = createBaseMsgReactivateKCPResponse();\n return message;\n },\n};\n\nfunction createBaseMsgRevokeKCP(): MsgRevokeKCP {\n return { authority: \"\", citizen_id: 0n, reason_code: \"\", evidence_ref: \"\" };\n}\n\nexport const MsgRevokeKCP: MessageFns<MsgRevokeKCP> = {\n encode(message: MsgRevokeKCP, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.citizen_id !== 0n) {\n if (BigInt.asUintN(64, message.citizen_id) !== message.citizen_id) {\n throw new globalThis.Error(\"value provided for field message.citizen_id of type uint64 too large\");\n }\n writer.uint32(16).uint64(message.citizen_id);\n }\n if (message.reason_code !== \"\") {\n writer.uint32(26).string(message.reason_code);\n }\n if (message.evidence_ref !== \"\") {\n writer.uint32(34).string(message.evidence_ref);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeKCP {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgRevokeKCP();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 16) {\n break;\n }\n\n message.citizen_id = reader.uint64() as bigint;\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.reason_code = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.evidence_ref = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgRevokeKCP>): MsgRevokeKCP {\n return MsgRevokeKCP.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgRevokeKCP>): MsgRevokeKCP {\n const message = createBaseMsgRevokeKCP();\n message.authority = object.authority ?? \"\";\n message.citizen_id = (object.citizen_id !== undefined && object.citizen_id !== null)\n ? BigInt(object.citizen_id)\n : 0n;\n message.reason_code = object.reason_code ?? \"\";\n message.evidence_ref = object.evidence_ref ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgRevokeKCPResponse(): MsgRevokeKCPResponse {\n return {};\n}\n\nexport const MsgRevokeKCPResponse: MessageFns<MsgRevokeKCPResponse> = {\n encode(_: MsgRevokeKCPResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeKCPResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgRevokeKCPResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgRevokeKCPResponse>): MsgRevokeKCPResponse {\n return MsgRevokeKCPResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgRevokeKCPResponse>): MsgRevokeKCPResponse {\n const message = createBaseMsgRevokeKCPResponse();\n return message;\n },\n};\n\nfunction createBaseMsgInitiateRecovery(): MsgInitiateRecovery {\n return { authority: \"\", citizen_id: 0n, new_wallet: \"\", recovery_case_id: \"\", cooling_off_ends_at: undefined };\n}\n\nexport const MsgInitiateRecovery: MessageFns<MsgInitiateRecovery> = {\n encode(message: MsgInitiateRecovery, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.citizen_id !== 0n) {\n if (BigInt.asUintN(64, message.citizen_id) !== message.citizen_id) {\n throw new globalThis.Error(\"value provided for field message.citizen_id of type uint64 too large\");\n }\n writer.uint32(16).uint64(message.citizen_id);\n }\n if (message.new_wallet !== \"\") {\n writer.uint32(26).string(message.new_wallet);\n }\n if (message.recovery_case_id !== \"\") {\n writer.uint32(34).string(message.recovery_case_id);\n }\n if (message.cooling_off_ends_at !== undefined) {\n Timestamp.encode(toTimestamp(message.cooling_off_ends_at), writer.uint32(42).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgInitiateRecovery {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgInitiateRecovery();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 16) {\n break;\n }\n\n message.citizen_id = reader.uint64() as bigint;\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.new_wallet = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.recovery_case_id = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.cooling_off_ends_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgInitiateRecovery>): MsgInitiateRecovery {\n return MsgInitiateRecovery.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgInitiateRecovery>): MsgInitiateRecovery {\n const message = createBaseMsgInitiateRecovery();\n message.authority = object.authority ?? \"\";\n message.citizen_id = (object.citizen_id !== undefined && object.citizen_id !== null)\n ? BigInt(object.citizen_id)\n : 0n;\n message.new_wallet = object.new_wallet ?? \"\";\n message.recovery_case_id = object.recovery_case_id ?? \"\";\n message.cooling_off_ends_at = object.cooling_off_ends_at ?? undefined;\n return message;\n },\n};\n\nfunction createBaseMsgInitiateRecoveryResponse(): MsgInitiateRecoveryResponse {\n return {};\n}\n\nexport const MsgInitiateRecoveryResponse: MessageFns<MsgInitiateRecoveryResponse> = {\n encode(_: MsgInitiateRecoveryResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgInitiateRecoveryResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgInitiateRecoveryResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgInitiateRecoveryResponse>): MsgInitiateRecoveryResponse {\n return MsgInitiateRecoveryResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgInitiateRecoveryResponse>): MsgInitiateRecoveryResponse {\n const message = createBaseMsgInitiateRecoveryResponse();\n return message;\n },\n};\n\nfunction createBaseMsgApproveRecovery(): MsgApproveRecovery {\n return { authority: \"\", recovery_case_id: \"\" };\n}\n\nexport const MsgApproveRecovery: MessageFns<MsgApproveRecovery> = {\n encode(message: MsgApproveRecovery, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.recovery_case_id !== \"\") {\n writer.uint32(18).string(message.recovery_case_id);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgApproveRecovery {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgApproveRecovery();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.recovery_case_id = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgApproveRecovery>): MsgApproveRecovery {\n return MsgApproveRecovery.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgApproveRecovery>): MsgApproveRecovery {\n const message = createBaseMsgApproveRecovery();\n message.authority = object.authority ?? \"\";\n message.recovery_case_id = object.recovery_case_id ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgApproveRecoveryResponse(): MsgApproveRecoveryResponse {\n return {};\n}\n\nexport const MsgApproveRecoveryResponse: MessageFns<MsgApproveRecoveryResponse> = {\n encode(_: MsgApproveRecoveryResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgApproveRecoveryResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgApproveRecoveryResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgApproveRecoveryResponse>): MsgApproveRecoveryResponse {\n return MsgApproveRecoveryResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgApproveRecoveryResponse>): MsgApproveRecoveryResponse {\n const message = createBaseMsgApproveRecoveryResponse();\n return message;\n },\n};\n\nfunction createBaseMsgFinalizeRecovery(): MsgFinalizeRecovery {\n return { authority: \"\", recovery_case_id: \"\", decision_id: \"\" };\n}\n\nexport const MsgFinalizeRecovery: MessageFns<MsgFinalizeRecovery> = {\n encode(message: MsgFinalizeRecovery, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.recovery_case_id !== \"\") {\n writer.uint32(18).string(message.recovery_case_id);\n }\n if (message.decision_id !== \"\") {\n writer.uint32(26).string(message.decision_id);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgFinalizeRecovery {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgFinalizeRecovery();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.recovery_case_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.decision_id = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgFinalizeRecovery>): MsgFinalizeRecovery {\n return MsgFinalizeRecovery.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgFinalizeRecovery>): MsgFinalizeRecovery {\n const message = createBaseMsgFinalizeRecovery();\n message.authority = object.authority ?? \"\";\n message.recovery_case_id = object.recovery_case_id ?? \"\";\n message.decision_id = object.decision_id ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgFinalizeRecoveryResponse(): MsgFinalizeRecoveryResponse {\n return {};\n}\n\nexport const MsgFinalizeRecoveryResponse: MessageFns<MsgFinalizeRecoveryResponse> = {\n encode(_: MsgFinalizeRecoveryResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgFinalizeRecoveryResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgFinalizeRecoveryResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgFinalizeRecoveryResponse>): MsgFinalizeRecoveryResponse {\n return MsgFinalizeRecoveryResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgFinalizeRecoveryResponse>): MsgFinalizeRecoveryResponse {\n const message = createBaseMsgFinalizeRecoveryResponse();\n return message;\n },\n};\n\nfunction createBaseMsgCancelRecovery(): MsgCancelRecovery {\n return { authority: \"\", recovery_case_id: \"\", reason_code: \"\" };\n}\n\nexport const MsgCancelRecovery: MessageFns<MsgCancelRecovery> = {\n encode(message: MsgCancelRecovery, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.recovery_case_id !== \"\") {\n writer.uint32(18).string(message.recovery_case_id);\n }\n if (message.reason_code !== \"\") {\n writer.uint32(26).string(message.reason_code);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelRecovery {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgCancelRecovery();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.recovery_case_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.reason_code = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgCancelRecovery>): MsgCancelRecovery {\n return MsgCancelRecovery.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgCancelRecovery>): MsgCancelRecovery {\n const message = createBaseMsgCancelRecovery();\n message.authority = object.authority ?? \"\";\n message.recovery_case_id = object.recovery_case_id ?? \"\";\n message.reason_code = object.reason_code ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgCancelRecoveryResponse(): MsgCancelRecoveryResponse {\n return {};\n}\n\nexport const MsgCancelRecoveryResponse: MessageFns<MsgCancelRecoveryResponse> = {\n encode(_: MsgCancelRecoveryResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelRecoveryResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgCancelRecoveryResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgCancelRecoveryResponse>): MsgCancelRecoveryResponse {\n return MsgCancelRecoveryResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgCancelRecoveryResponse>): MsgCancelRecoveryResponse {\n const message = createBaseMsgCancelRecoveryResponse();\n return message;\n },\n};\n\nexport type MsgDefinition = typeof MsgDefinition;\nexport const MsgDefinition = {\n name: \"Msg\",\n fullName: \"isatheword.kingdomchain.citizen.v1.Msg\",\n methods: {\n issueKCP: {\n name: \"IssueKCP\",\n requestType: MsgIssueKCP as typeof MsgIssueKCP,\n requestStream: false,\n responseType: MsgIssueKCPResponse as typeof MsgIssueKCPResponse,\n responseStream: false,\n options: {},\n },\n suspendKCP: {\n name: \"SuspendKCP\",\n requestType: MsgSuspendKCP as typeof MsgSuspendKCP,\n requestStream: false,\n responseType: MsgSuspendKCPResponse as typeof MsgSuspendKCPResponse,\n responseStream: false,\n options: {},\n },\n reactivateKCP: {\n name: \"ReactivateKCP\",\n requestType: MsgReactivateKCP as typeof MsgReactivateKCP,\n requestStream: false,\n responseType: MsgReactivateKCPResponse as typeof MsgReactivateKCPResponse,\n responseStream: false,\n options: {},\n },\n revokeKCP: {\n name: \"RevokeKCP\",\n requestType: MsgRevokeKCP as typeof MsgRevokeKCP,\n requestStream: false,\n responseType: MsgRevokeKCPResponse as typeof MsgRevokeKCPResponse,\n responseStream: false,\n options: {},\n },\n initiateRecovery: {\n name: \"InitiateRecovery\",\n requestType: MsgInitiateRecovery as typeof MsgInitiateRecovery,\n requestStream: false,\n responseType: MsgInitiateRecoveryResponse as typeof MsgInitiateRecoveryResponse,\n responseStream: false,\n options: {},\n },\n approveRecovery: {\n name: \"ApproveRecovery\",\n requestType: MsgApproveRecovery as typeof MsgApproveRecovery,\n requestStream: false,\n responseType: MsgApproveRecoveryResponse as typeof MsgApproveRecoveryResponse,\n responseStream: false,\n options: {},\n },\n finalizeRecovery: {\n name: \"FinalizeRecovery\",\n requestType: MsgFinalizeRecovery as typeof MsgFinalizeRecovery,\n requestStream: false,\n responseType: MsgFinalizeRecoveryResponse as typeof MsgFinalizeRecoveryResponse,\n responseStream: false,\n options: {},\n },\n cancelRecovery: {\n name: \"CancelRecovery\",\n requestType: MsgCancelRecovery as typeof MsgCancelRecovery,\n requestStream: false,\n responseType: MsgCancelRecoveryResponse as typeof MsgCancelRecoveryResponse,\n responseStream: false,\n options: {},\n },\n },\n} as const;\n\ntype Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;\n\ntype DeepPartial<T> = T extends bigint ? string | number | bigint\n : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>\n : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>\n : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }\n : Partial<T>;\n\nfunction toTimestamp(date: Date): Timestamp {\n const seconds = BigInt(Math.trunc(date.getTime() / 1_000));\n const nanos = (date.getTime() % 1_000) * 1_000_000;\n return { seconds, nanos };\n}\n\nfunction fromTimestamp(t: Timestamp): Date {\n let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1_000;\n millis += (t.nanos || 0) / 1_000_000;\n return new globalThis.Date(millis);\n}\n\ninterface MessageFns<T> {\n encode(message: T, writer?: BinaryWriter): BinaryWriter;\n decode(input: BinaryReader | Uint8Array, length?: number): T;\n create(base?: DeepPartial<T>): T;\n fromPartial(object: DeepPartial<T>): T;\n}\n","// Code generated by protoc-gen-ts_proto. DO NOT EDIT.\n// versions:\n// protoc-gen-ts_proto v2.12.0\n// protoc unknown\n// source: isatheword/kingdomchain/compliance/v1/tx.proto\n\n/* eslint-disable */\nimport { BinaryReader, BinaryWriter } from \"@bufbuild/protobuf/wire\";\nimport { Timestamp } from \"../../../../google/protobuf/timestamp\";\n\nexport interface MsgRegisterProvider {\n authority: string;\n provider_id: string;\n public_key: string;\n key_version: bigint;\n supported_assurance_levels: string[];\n supported_jurisdictions: string[];\n active_from?: Date | undefined;\n active_until?: Date | undefined;\n}\n\nexport interface MsgRegisterProviderResponse {\n}\n\nexport interface MsgSuspendProvider {\n authority: string;\n provider_id: string;\n reason_code: string;\n}\n\nexport interface MsgSuspendProviderResponse {\n}\n\nexport interface MsgSubmitApplication {\n applicant_wallet: string;\n application_id: string;\n provider_id: string;\n provider_key_version: bigint;\n chain_id: string;\n case_id: string;\n policy_version: string;\n nonce: string;\n uniqueness_reference: string;\n issued_at?: Date | undefined;\n expires_at?: Date | undefined;\n signature: string;\n}\n\nexport interface MsgSubmitApplicationResponse {\n}\n\nexport interface MsgSubmitRecoveryAttestation {\n applicant_wallet: string;\n recovery_case_id: string;\n provider_id: string;\n provider_key_version: bigint;\n chain_id: string;\n case_id: string;\n policy_version: string;\n nonce: string;\n uniqueness_reference: string;\n citizen_id: bigint;\n old_wallet: string;\n new_wallet: string;\n issued_at?: Date | undefined;\n expires_at?: Date | undefined;\n signature: string;\n}\n\nexport interface MsgSubmitRecoveryAttestationResponse {\n}\n\nexport interface MsgDecideApplication {\n authority: string;\n application_id: string;\n approved: boolean;\n reason_code: string;\n}\n\nexport interface MsgDecideApplicationResponse {\n}\n\nexport interface MsgDecideRecoveryAttestation {\n authority: string;\n recovery_case_id: string;\n approved: boolean;\n reason_code: string;\n}\n\nexport interface MsgDecideRecoveryAttestationResponse {\n}\n\nfunction createBaseMsgRegisterProvider(): MsgRegisterProvider {\n return {\n authority: \"\",\n provider_id: \"\",\n public_key: \"\",\n key_version: 0n,\n supported_assurance_levels: [],\n supported_jurisdictions: [],\n active_from: undefined,\n active_until: undefined,\n };\n}\n\nexport const MsgRegisterProvider: MessageFns<MsgRegisterProvider> = {\n encode(message: MsgRegisterProvider, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.provider_id !== \"\") {\n writer.uint32(18).string(message.provider_id);\n }\n if (message.public_key !== \"\") {\n writer.uint32(26).string(message.public_key);\n }\n if (message.key_version !== 0n) {\n if (BigInt.asUintN(64, message.key_version) !== message.key_version) {\n throw new globalThis.Error(\"value provided for field message.key_version of type uint64 too large\");\n }\n writer.uint32(32).uint64(message.key_version);\n }\n for (const v of message.supported_assurance_levels) {\n writer.uint32(42).string(v!);\n }\n for (const v of message.supported_jurisdictions) {\n writer.uint32(50).string(v!);\n }\n if (message.active_from !== undefined) {\n Timestamp.encode(toTimestamp(message.active_from), writer.uint32(58).fork()).join();\n }\n if (message.active_until !== undefined) {\n Timestamp.encode(toTimestamp(message.active_until), writer.uint32(66).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterProvider {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgRegisterProvider();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.provider_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.public_key = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 32) {\n break;\n }\n\n message.key_version = reader.uint64() as bigint;\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.supported_assurance_levels.push(reader.string());\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.supported_jurisdictions.push(reader.string());\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.active_from = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.active_until = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgRegisterProvider>): MsgRegisterProvider {\n return MsgRegisterProvider.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgRegisterProvider>): MsgRegisterProvider {\n const message = createBaseMsgRegisterProvider();\n message.authority = object.authority ?? \"\";\n message.provider_id = object.provider_id ?? \"\";\n message.public_key = object.public_key ?? \"\";\n message.key_version = (object.key_version !== undefined && object.key_version !== null)\n ? BigInt(object.key_version)\n : 0n;\n message.supported_assurance_levels = object.supported_assurance_levels?.map((e) => e) || [];\n message.supported_jurisdictions = object.supported_jurisdictions?.map((e) => e) || [];\n message.active_from = object.active_from ?? undefined;\n message.active_until = object.active_until ?? undefined;\n return message;\n },\n};\n\nfunction createBaseMsgRegisterProviderResponse(): MsgRegisterProviderResponse {\n return {};\n}\n\nexport const MsgRegisterProviderResponse: MessageFns<MsgRegisterProviderResponse> = {\n encode(_: MsgRegisterProviderResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterProviderResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgRegisterProviderResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgRegisterProviderResponse>): MsgRegisterProviderResponse {\n return MsgRegisterProviderResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgRegisterProviderResponse>): MsgRegisterProviderResponse {\n const message = createBaseMsgRegisterProviderResponse();\n return message;\n },\n};\n\nfunction createBaseMsgSuspendProvider(): MsgSuspendProvider {\n return { authority: \"\", provider_id: \"\", reason_code: \"\" };\n}\n\nexport const MsgSuspendProvider: MessageFns<MsgSuspendProvider> = {\n encode(message: MsgSuspendProvider, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.provider_id !== \"\") {\n writer.uint32(18).string(message.provider_id);\n }\n if (message.reason_code !== \"\") {\n writer.uint32(26).string(message.reason_code);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgSuspendProvider {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgSuspendProvider();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.provider_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.reason_code = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgSuspendProvider>): MsgSuspendProvider {\n return MsgSuspendProvider.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgSuspendProvider>): MsgSuspendProvider {\n const message = createBaseMsgSuspendProvider();\n message.authority = object.authority ?? \"\";\n message.provider_id = object.provider_id ?? \"\";\n message.reason_code = object.reason_code ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgSuspendProviderResponse(): MsgSuspendProviderResponse {\n return {};\n}\n\nexport const MsgSuspendProviderResponse: MessageFns<MsgSuspendProviderResponse> = {\n encode(_: MsgSuspendProviderResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgSuspendProviderResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgSuspendProviderResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgSuspendProviderResponse>): MsgSuspendProviderResponse {\n return MsgSuspendProviderResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgSuspendProviderResponse>): MsgSuspendProviderResponse {\n const message = createBaseMsgSuspendProviderResponse();\n return message;\n },\n};\n\nfunction createBaseMsgSubmitApplication(): MsgSubmitApplication {\n return {\n applicant_wallet: \"\",\n application_id: \"\",\n provider_id: \"\",\n provider_key_version: 0n,\n chain_id: \"\",\n case_id: \"\",\n policy_version: \"\",\n nonce: \"\",\n uniqueness_reference: \"\",\n issued_at: undefined,\n expires_at: undefined,\n signature: \"\",\n };\n}\n\nexport const MsgSubmitApplication: MessageFns<MsgSubmitApplication> = {\n encode(message: MsgSubmitApplication, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.applicant_wallet !== \"\") {\n writer.uint32(10).string(message.applicant_wallet);\n }\n if (message.application_id !== \"\") {\n writer.uint32(18).string(message.application_id);\n }\n if (message.provider_id !== \"\") {\n writer.uint32(26).string(message.provider_id);\n }\n if (message.provider_key_version !== 0n) {\n if (BigInt.asUintN(64, message.provider_key_version) !== message.provider_key_version) {\n throw new globalThis.Error(\"value provided for field message.provider_key_version of type uint64 too large\");\n }\n writer.uint32(32).uint64(message.provider_key_version);\n }\n if (message.chain_id !== \"\") {\n writer.uint32(42).string(message.chain_id);\n }\n if (message.case_id !== \"\") {\n writer.uint32(50).string(message.case_id);\n }\n if (message.policy_version !== \"\") {\n writer.uint32(58).string(message.policy_version);\n }\n if (message.nonce !== \"\") {\n writer.uint32(66).string(message.nonce);\n }\n if (message.uniqueness_reference !== \"\") {\n writer.uint32(74).string(message.uniqueness_reference);\n }\n if (message.issued_at !== undefined) {\n Timestamp.encode(toTimestamp(message.issued_at), writer.uint32(82).fork()).join();\n }\n if (message.expires_at !== undefined) {\n Timestamp.encode(toTimestamp(message.expires_at), writer.uint32(90).fork()).join();\n }\n if (message.signature !== \"\") {\n writer.uint32(98).string(message.signature);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitApplication {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgSubmitApplication();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.applicant_wallet = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.application_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.provider_id = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 32) {\n break;\n }\n\n message.provider_key_version = reader.uint64() as bigint;\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.chain_id = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.case_id = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.policy_version = reader.string();\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.nonce = reader.string();\n continue;\n }\n case 9: {\n if (tag !== 74) {\n break;\n }\n\n message.uniqueness_reference = reader.string();\n continue;\n }\n case 10: {\n if (tag !== 82) {\n break;\n }\n\n message.issued_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 11: {\n if (tag !== 90) {\n break;\n }\n\n message.expires_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 12: {\n if (tag !== 98) {\n break;\n }\n\n message.signature = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgSubmitApplication>): MsgSubmitApplication {\n return MsgSubmitApplication.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgSubmitApplication>): MsgSubmitApplication {\n const message = createBaseMsgSubmitApplication();\n message.applicant_wallet = object.applicant_wallet ?? \"\";\n message.application_id = object.application_id ?? \"\";\n message.provider_id = object.provider_id ?? \"\";\n message.provider_key_version = (object.provider_key_version !== undefined && object.provider_key_version !== null)\n ? BigInt(object.provider_key_version)\n : 0n;\n message.chain_id = object.chain_id ?? \"\";\n message.case_id = object.case_id ?? \"\";\n message.policy_version = object.policy_version ?? \"\";\n message.nonce = object.nonce ?? \"\";\n message.uniqueness_reference = object.uniqueness_reference ?? \"\";\n message.issued_at = object.issued_at ?? undefined;\n message.expires_at = object.expires_at ?? undefined;\n message.signature = object.signature ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgSubmitApplicationResponse(): MsgSubmitApplicationResponse {\n return {};\n}\n\nexport const MsgSubmitApplicationResponse: MessageFns<MsgSubmitApplicationResponse> = {\n encode(_: MsgSubmitApplicationResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitApplicationResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgSubmitApplicationResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgSubmitApplicationResponse>): MsgSubmitApplicationResponse {\n return MsgSubmitApplicationResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgSubmitApplicationResponse>): MsgSubmitApplicationResponse {\n const message = createBaseMsgSubmitApplicationResponse();\n return message;\n },\n};\n\nfunction createBaseMsgSubmitRecoveryAttestation(): MsgSubmitRecoveryAttestation {\n return {\n applicant_wallet: \"\",\n recovery_case_id: \"\",\n provider_id: \"\",\n provider_key_version: 0n,\n chain_id: \"\",\n case_id: \"\",\n policy_version: \"\",\n nonce: \"\",\n uniqueness_reference: \"\",\n citizen_id: 0n,\n old_wallet: \"\",\n new_wallet: \"\",\n issued_at: undefined,\n expires_at: undefined,\n signature: \"\",\n };\n}\n\nexport const MsgSubmitRecoveryAttestation: MessageFns<MsgSubmitRecoveryAttestation> = {\n encode(message: MsgSubmitRecoveryAttestation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.applicant_wallet !== \"\") {\n writer.uint32(10).string(message.applicant_wallet);\n }\n if (message.recovery_case_id !== \"\") {\n writer.uint32(18).string(message.recovery_case_id);\n }\n if (message.provider_id !== \"\") {\n writer.uint32(26).string(message.provider_id);\n }\n if (message.provider_key_version !== 0n) {\n if (BigInt.asUintN(64, message.provider_key_version) !== message.provider_key_version) {\n throw new globalThis.Error(\"value provided for field message.provider_key_version of type uint64 too large\");\n }\n writer.uint32(32).uint64(message.provider_key_version);\n }\n if (message.chain_id !== \"\") {\n writer.uint32(42).string(message.chain_id);\n }\n if (message.case_id !== \"\") {\n writer.uint32(50).string(message.case_id);\n }\n if (message.policy_version !== \"\") {\n writer.uint32(58).string(message.policy_version);\n }\n if (message.nonce !== \"\") {\n writer.uint32(66).string(message.nonce);\n }\n if (message.uniqueness_reference !== \"\") {\n writer.uint32(74).string(message.uniqueness_reference);\n }\n if (message.citizen_id !== 0n) {\n if (BigInt.asUintN(64, message.citizen_id) !== message.citizen_id) {\n throw new globalThis.Error(\"value provided for field message.citizen_id of type uint64 too large\");\n }\n writer.uint32(80).uint64(message.citizen_id);\n }\n if (message.old_wallet !== \"\") {\n writer.uint32(90).string(message.old_wallet);\n }\n if (message.new_wallet !== \"\") {\n writer.uint32(98).string(message.new_wallet);\n }\n if (message.issued_at !== undefined) {\n Timestamp.encode(toTimestamp(message.issued_at), writer.uint32(106).fork()).join();\n }\n if (message.expires_at !== undefined) {\n Timestamp.encode(toTimestamp(message.expires_at), writer.uint32(114).fork()).join();\n }\n if (message.signature !== \"\") {\n writer.uint32(122).string(message.signature);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitRecoveryAttestation {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgSubmitRecoveryAttestation();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.applicant_wallet = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.recovery_case_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 26) {\n break;\n }\n\n message.provider_id = reader.string();\n continue;\n }\n case 4: {\n if (tag !== 32) {\n break;\n }\n\n message.provider_key_version = reader.uint64() as bigint;\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.chain_id = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.case_id = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.policy_version = reader.string();\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.nonce = reader.string();\n continue;\n }\n case 9: {\n if (tag !== 74) {\n break;\n }\n\n message.uniqueness_reference = reader.string();\n continue;\n }\n case 10: {\n if (tag !== 80) {\n break;\n }\n\n message.citizen_id = reader.uint64() as bigint;\n continue;\n }\n case 11: {\n if (tag !== 90) {\n break;\n }\n\n message.old_wallet = reader.string();\n continue;\n }\n case 12: {\n if (tag !== 98) {\n break;\n }\n\n message.new_wallet = reader.string();\n continue;\n }\n case 13: {\n if (tag !== 106) {\n break;\n }\n\n message.issued_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 14: {\n if (tag !== 114) {\n break;\n }\n\n message.expires_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 15: {\n if (tag !== 122) {\n break;\n }\n\n message.signature = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgSubmitRecoveryAttestation>): MsgSubmitRecoveryAttestation {\n return MsgSubmitRecoveryAttestation.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgSubmitRecoveryAttestation>): MsgSubmitRecoveryAttestation {\n const message = createBaseMsgSubmitRecoveryAttestation();\n message.applicant_wallet = object.applicant_wallet ?? \"\";\n message.recovery_case_id = object.recovery_case_id ?? \"\";\n message.provider_id = object.provider_id ?? \"\";\n message.provider_key_version = (object.provider_key_version !== undefined && object.provider_key_version !== null)\n ? BigInt(object.provider_key_version)\n : 0n;\n message.chain_id = object.chain_id ?? \"\";\n message.case_id = object.case_id ?? \"\";\n message.policy_version = object.policy_version ?? \"\";\n message.nonce = object.nonce ?? \"\";\n message.uniqueness_reference = object.uniqueness_reference ?? \"\";\n message.citizen_id = (object.citizen_id !== undefined && object.citizen_id !== null)\n ? BigInt(object.citizen_id)\n : 0n;\n message.old_wallet = object.old_wallet ?? \"\";\n message.new_wallet = object.new_wallet ?? \"\";\n message.issued_at = object.issued_at ?? undefined;\n message.expires_at = object.expires_at ?? undefined;\n message.signature = object.signature ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgSubmitRecoveryAttestationResponse(): MsgSubmitRecoveryAttestationResponse {\n return {};\n}\n\nexport const MsgSubmitRecoveryAttestationResponse: MessageFns<MsgSubmitRecoveryAttestationResponse> = {\n encode(_: MsgSubmitRecoveryAttestationResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitRecoveryAttestationResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgSubmitRecoveryAttestationResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgSubmitRecoveryAttestationResponse>): MsgSubmitRecoveryAttestationResponse {\n return MsgSubmitRecoveryAttestationResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgSubmitRecoveryAttestationResponse>): MsgSubmitRecoveryAttestationResponse {\n const message = createBaseMsgSubmitRecoveryAttestationResponse();\n return message;\n },\n};\n\nfunction createBaseMsgDecideApplication(): MsgDecideApplication {\n return { authority: \"\", application_id: \"\", approved: false, reason_code: \"\" };\n}\n\nexport const MsgDecideApplication: MessageFns<MsgDecideApplication> = {\n encode(message: MsgDecideApplication, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.application_id !== \"\") {\n writer.uint32(18).string(message.application_id);\n }\n if (message.approved !== false) {\n writer.uint32(24).bool(message.approved);\n }\n if (message.reason_code !== \"\") {\n writer.uint32(34).string(message.reason_code);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgDecideApplication {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgDecideApplication();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.application_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.approved = reader.bool();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.reason_code = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgDecideApplication>): MsgDecideApplication {\n return MsgDecideApplication.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgDecideApplication>): MsgDecideApplication {\n const message = createBaseMsgDecideApplication();\n message.authority = object.authority ?? \"\";\n message.application_id = object.application_id ?? \"\";\n message.approved = object.approved ?? false;\n message.reason_code = object.reason_code ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgDecideApplicationResponse(): MsgDecideApplicationResponse {\n return {};\n}\n\nexport const MsgDecideApplicationResponse: MessageFns<MsgDecideApplicationResponse> = {\n encode(_: MsgDecideApplicationResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgDecideApplicationResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgDecideApplicationResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgDecideApplicationResponse>): MsgDecideApplicationResponse {\n return MsgDecideApplicationResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgDecideApplicationResponse>): MsgDecideApplicationResponse {\n const message = createBaseMsgDecideApplicationResponse();\n return message;\n },\n};\n\nfunction createBaseMsgDecideRecoveryAttestation(): MsgDecideRecoveryAttestation {\n return { authority: \"\", recovery_case_id: \"\", approved: false, reason_code: \"\" };\n}\n\nexport const MsgDecideRecoveryAttestation: MessageFns<MsgDecideRecoveryAttestation> = {\n encode(message: MsgDecideRecoveryAttestation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.authority !== \"\") {\n writer.uint32(10).string(message.authority);\n }\n if (message.recovery_case_id !== \"\") {\n writer.uint32(18).string(message.recovery_case_id);\n }\n if (message.approved !== false) {\n writer.uint32(24).bool(message.approved);\n }\n if (message.reason_code !== \"\") {\n writer.uint32(34).string(message.reason_code);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgDecideRecoveryAttestation {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgDecideRecoveryAttestation();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.authority = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.recovery_case_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.approved = reader.bool();\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.reason_code = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgDecideRecoveryAttestation>): MsgDecideRecoveryAttestation {\n return MsgDecideRecoveryAttestation.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<MsgDecideRecoveryAttestation>): MsgDecideRecoveryAttestation {\n const message = createBaseMsgDecideRecoveryAttestation();\n message.authority = object.authority ?? \"\";\n message.recovery_case_id = object.recovery_case_id ?? \"\";\n message.approved = object.approved ?? false;\n message.reason_code = object.reason_code ?? \"\";\n return message;\n },\n};\n\nfunction createBaseMsgDecideRecoveryAttestationResponse(): MsgDecideRecoveryAttestationResponse {\n return {};\n}\n\nexport const MsgDecideRecoveryAttestationResponse: MessageFns<MsgDecideRecoveryAttestationResponse> = {\n encode(_: MsgDecideRecoveryAttestationResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): MsgDecideRecoveryAttestationResponse {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseMsgDecideRecoveryAttestationResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<MsgDecideRecoveryAttestationResponse>): MsgDecideRecoveryAttestationResponse {\n return MsgDecideRecoveryAttestationResponse.fromPartial(base ?? {});\n },\n fromPartial(_: DeepPartial<MsgDecideRecoveryAttestationResponse>): MsgDecideRecoveryAttestationResponse {\n const message = createBaseMsgDecideRecoveryAttestationResponse();\n return message;\n },\n};\n\nexport type MsgDefinition = typeof MsgDefinition;\nexport const MsgDefinition = {\n name: \"Msg\",\n fullName: \"isatheword.kingdomchain.compliance.v1.Msg\",\n methods: {\n registerProvider: {\n name: \"RegisterProvider\",\n requestType: MsgRegisterProvider as typeof MsgRegisterProvider,\n requestStream: false,\n responseType: MsgRegisterProviderResponse as typeof MsgRegisterProviderResponse,\n responseStream: false,\n options: {},\n },\n suspendProvider: {\n name: \"SuspendProvider\",\n requestType: MsgSuspendProvider as typeof MsgSuspendProvider,\n requestStream: false,\n responseType: MsgSuspendProviderResponse as typeof MsgSuspendProviderResponse,\n responseStream: false,\n options: {},\n },\n submitApplication: {\n name: \"SubmitApplication\",\n requestType: MsgSubmitApplication as typeof MsgSubmitApplication,\n requestStream: false,\n responseType: MsgSubmitApplicationResponse as typeof MsgSubmitApplicationResponse,\n responseStream: false,\n options: {},\n },\n submitRecoveryAttestation: {\n name: \"SubmitRecoveryAttestation\",\n requestType: MsgSubmitRecoveryAttestation as typeof MsgSubmitRecoveryAttestation,\n requestStream: false,\n responseType: MsgSubmitRecoveryAttestationResponse as typeof MsgSubmitRecoveryAttestationResponse,\n responseStream: false,\n options: {},\n },\n decideApplication: {\n name: \"DecideApplication\",\n requestType: MsgDecideApplication as typeof MsgDecideApplication,\n requestStream: false,\n responseType: MsgDecideApplicationResponse as typeof MsgDecideApplicationResponse,\n responseStream: false,\n options: {},\n },\n decideRecoveryAttestation: {\n name: \"DecideRecoveryAttestation\",\n requestType: MsgDecideRecoveryAttestation as typeof MsgDecideRecoveryAttestation,\n requestStream: false,\n responseType: MsgDecideRecoveryAttestationResponse as typeof MsgDecideRecoveryAttestationResponse,\n responseStream: false,\n options: {},\n },\n },\n} as const;\n\ntype Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;\n\ntype DeepPartial<T> = T extends bigint ? string | number | bigint\n : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>\n : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>\n : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }\n : Partial<T>;\n\nfunction toTimestamp(date: Date): Timestamp {\n const seconds = BigInt(Math.trunc(date.getTime() / 1_000));\n const nanos = (date.getTime() % 1_000) * 1_000_000;\n return { seconds, nanos };\n}\n\nfunction fromTimestamp(t: Timestamp): Date {\n let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1_000;\n millis += (t.nanos || 0) / 1_000_000;\n return new globalThis.Date(millis);\n}\n\ninterface MessageFns<T> {\n encode(message: T, writer?: BinaryWriter): BinaryWriter;\n decode(input: BinaryReader | Uint8Array, length?: number): T;\n create(base?: DeepPartial<T>): T;\n fromPartial(object: DeepPartial<T>): T;\n}\n","// Code generated by protoc-gen-ts_proto. DO NOT EDIT.\n// versions:\n// protoc-gen-ts_proto v2.12.0\n// protoc unknown\n// source: isatheword/kingdomchain/compliance/v1/compliance.proto\n\n/* eslint-disable */\nimport { BinaryReader, BinaryWriter } from \"@bufbuild/protobuf/wire\";\nimport { Timestamp } from \"../../../../google/protobuf/timestamp\";\n\nexport enum ProviderStatus {\n PROVIDER_STATUS_UNSPECIFIED = 0,\n PROVIDER_STATUS_ACTIVE = 1,\n PROVIDER_STATUS_SUSPENDED = 2,\n PROVIDER_STATUS_REVOKED = 3,\n UNRECOGNIZED = -1,\n}\n\nexport enum AttestationType {\n ATTESTATION_TYPE_UNSPECIFIED = 0,\n ATTESTATION_TYPE_CITIZENSHIP_APPLICATION = 1,\n ATTESTATION_TYPE_RECOVERY = 2,\n UNRECOGNIZED = -1,\n}\n\nexport enum ApplicationStatus {\n APPLICATION_STATUS_UNSPECIFIED = 0,\n APPLICATION_STATUS_SUBMITTED = 1,\n APPLICATION_STATUS_PENDING_REVIEW = 2,\n APPLICATION_STATUS_APPROVED = 3,\n APPLICATION_STATUS_REJECTED = 4,\n UNRECOGNIZED = -1,\n}\n\nexport enum RecoveryAttestationStatus {\n RECOVERY_ATTESTATION_STATUS_UNSPECIFIED = 0,\n RECOVERY_ATTESTATION_STATUS_SUBMITTED = 1,\n RECOVERY_ATTESTATION_STATUS_PENDING_REVIEW = 2,\n RECOVERY_ATTESTATION_STATUS_APPROVED = 3,\n RECOVERY_ATTESTATION_STATUS_REJECTED = 4,\n UNRECOGNIZED = -1,\n}\n\nexport interface ProviderRecord {\n provider_id: string;\n public_key: string;\n key_version: bigint;\n supported_assurance_levels: string[];\n supported_jurisdictions: string[];\n active_from?: Date | undefined;\n active_until?: Date | undefined;\n status: ProviderStatus;\n}\n\nexport interface Attestation {\n attestation_id: string;\n provider_id: string;\n provider_key_version: bigint;\n attestation_type: AttestationType;\n chain_id: string;\n intended_wallet: string;\n case_id: string;\n policy_version: string;\n nonce: string;\n uniqueness_reference: string;\n issued_at?: Date | undefined;\n expires_at?: Date | undefined;\n consumed: boolean;\n signature: string;\n citizen_id: bigint;\n old_wallet: string;\n new_wallet: string;\n}\n\nexport interface Application {\n application_id: string;\n applicant_wallet: string;\n status: ApplicationStatus;\n attestation_id: string;\n uniqueness_commitment: string;\n policy_version: string;\n decision_reason_code: string;\n submitted_at?: Date | undefined;\n decided_at?: Date | undefined;\n}\n\nexport interface RecoveryAttestationCase {\n recovery_case_id: string;\n applicant_wallet: string;\n status: RecoveryAttestationStatus;\n attestation_id: string;\n citizen_id: bigint;\n old_wallet: string;\n new_wallet: string;\n policy_version: string;\n decision_reason_code: string;\n submitted_at?: Date | undefined;\n decided_at?: Date | undefined;\n}\n\nfunction createBaseProviderRecord(): ProviderRecord {\n return {\n provider_id: \"\",\n public_key: \"\",\n key_version: 0n,\n supported_assurance_levels: [],\n supported_jurisdictions: [],\n active_from: undefined,\n active_until: undefined,\n status: 0,\n };\n}\n\nexport const ProviderRecord: MessageFns<ProviderRecord> = {\n encode(message: ProviderRecord, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.provider_id !== \"\") {\n writer.uint32(10).string(message.provider_id);\n }\n if (message.public_key !== \"\") {\n writer.uint32(18).string(message.public_key);\n }\n if (message.key_version !== 0n) {\n if (BigInt.asUintN(64, message.key_version) !== message.key_version) {\n throw new globalThis.Error(\"value provided for field message.key_version of type uint64 too large\");\n }\n writer.uint32(24).uint64(message.key_version);\n }\n for (const v of message.supported_assurance_levels) {\n writer.uint32(34).string(v!);\n }\n for (const v of message.supported_jurisdictions) {\n writer.uint32(42).string(v!);\n }\n if (message.active_from !== undefined) {\n Timestamp.encode(toTimestamp(message.active_from), writer.uint32(50).fork()).join();\n }\n if (message.active_until !== undefined) {\n Timestamp.encode(toTimestamp(message.active_until), writer.uint32(58).fork()).join();\n }\n if (message.status !== 0) {\n writer.uint32(64).int32(message.status);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): ProviderRecord {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseProviderRecord();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.provider_id = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.public_key = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.key_version = reader.uint64() as bigint;\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.supported_assurance_levels.push(reader.string());\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.supported_jurisdictions.push(reader.string());\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.active_from = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.active_until = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 8: {\n if (tag !== 64) {\n break;\n }\n\n message.status = reader.int32() as any;\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<ProviderRecord>): ProviderRecord {\n return ProviderRecord.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<ProviderRecord>): ProviderRecord {\n const message = createBaseProviderRecord();\n message.provider_id = object.provider_id ?? \"\";\n message.public_key = object.public_key ?? \"\";\n message.key_version = (object.key_version !== undefined && object.key_version !== null)\n ? BigInt(object.key_version)\n : 0n;\n message.supported_assurance_levels = object.supported_assurance_levels?.map((e) => e) || [];\n message.supported_jurisdictions = object.supported_jurisdictions?.map((e) => e) || [];\n message.active_from = object.active_from ?? undefined;\n message.active_until = object.active_until ?? undefined;\n message.status = object.status ?? 0;\n return message;\n },\n};\n\nfunction createBaseAttestation(): Attestation {\n return {\n attestation_id: \"\",\n provider_id: \"\",\n provider_key_version: 0n,\n attestation_type: 0,\n chain_id: \"\",\n intended_wallet: \"\",\n case_id: \"\",\n policy_version: \"\",\n nonce: \"\",\n uniqueness_reference: \"\",\n issued_at: undefined,\n expires_at: undefined,\n consumed: false,\n signature: \"\",\n citizen_id: 0n,\n old_wallet: \"\",\n new_wallet: \"\",\n };\n}\n\nexport const Attestation: MessageFns<Attestation> = {\n encode(message: Attestation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.attestation_id !== \"\") {\n writer.uint32(10).string(message.attestation_id);\n }\n if (message.provider_id !== \"\") {\n writer.uint32(18).string(message.provider_id);\n }\n if (message.provider_key_version !== 0n) {\n if (BigInt.asUintN(64, message.provider_key_version) !== message.provider_key_version) {\n throw new globalThis.Error(\"value provided for field message.provider_key_version of type uint64 too large\");\n }\n writer.uint32(24).uint64(message.provider_key_version);\n }\n if (message.attestation_type !== 0) {\n writer.uint32(32).int32(message.attestation_type);\n }\n if (message.chain_id !== \"\") {\n writer.uint32(42).string(message.chain_id);\n }\n if (message.intended_wallet !== \"\") {\n writer.uint32(50).string(message.intended_wallet);\n }\n if (message.case_id !== \"\") {\n writer.uint32(58).string(message.case_id);\n }\n if (message.policy_version !== \"\") {\n writer.uint32(66).string(message.policy_version);\n }\n if (message.nonce !== \"\") {\n writer.uint32(74).string(message.nonce);\n }\n if (message.uniqueness_reference !== \"\") {\n writer.uint32(82).string(message.uniqueness_reference);\n }\n if (message.issued_at !== undefined) {\n Timestamp.encode(toTimestamp(message.issued_at), writer.uint32(90).fork()).join();\n }\n if (message.expires_at !== undefined) {\n Timestamp.encode(toTimestamp(message.expires_at), writer.uint32(98).fork()).join();\n }\n if (message.consumed !== false) {\n writer.uint32(104).bool(message.consumed);\n }\n if (message.signature !== \"\") {\n writer.uint32(114).string(message.signature);\n }\n if (message.citizen_id !== 0n) {\n if (BigInt.asUintN(64, message.citizen_id) !== message.citizen_id) {\n throw new globalThis.Error(\"value provided for field message.citizen_id of type uint64 too large\");\n }\n writer.uint32(120).uint64(message.citizen_id);\n }\n if (message.old_wallet !== \"\") {\n writer.uint32(130).string(message.old_wallet);\n }\n if (message.new_wallet !== \"\") {\n writer.uint32(138).string(message.new_wallet);\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Attestation {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseAttestation();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.attestation_id = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.provider_id = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.provider_key_version = reader.uint64() as bigint;\n continue;\n }\n case 4: {\n if (tag !== 32) {\n break;\n }\n\n message.attestation_type = reader.int32() as any;\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.chain_id = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.intended_wallet = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.case_id = reader.string();\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.policy_version = reader.string();\n continue;\n }\n case 9: {\n if (tag !== 74) {\n break;\n }\n\n message.nonce = reader.string();\n continue;\n }\n case 10: {\n if (tag !== 82) {\n break;\n }\n\n message.uniqueness_reference = reader.string();\n continue;\n }\n case 11: {\n if (tag !== 90) {\n break;\n }\n\n message.issued_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 12: {\n if (tag !== 98) {\n break;\n }\n\n message.expires_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 13: {\n if (tag !== 104) {\n break;\n }\n\n message.consumed = reader.bool();\n continue;\n }\n case 14: {\n if (tag !== 114) {\n break;\n }\n\n message.signature = reader.string();\n continue;\n }\n case 15: {\n if (tag !== 120) {\n break;\n }\n\n message.citizen_id = reader.uint64() as bigint;\n continue;\n }\n case 16: {\n if (tag !== 130) {\n break;\n }\n\n message.old_wallet = reader.string();\n continue;\n }\n case 17: {\n if (tag !== 138) {\n break;\n }\n\n message.new_wallet = reader.string();\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<Attestation>): Attestation {\n return Attestation.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<Attestation>): Attestation {\n const message = createBaseAttestation();\n message.attestation_id = object.attestation_id ?? \"\";\n message.provider_id = object.provider_id ?? \"\";\n message.provider_key_version = (object.provider_key_version !== undefined && object.provider_key_version !== null)\n ? BigInt(object.provider_key_version)\n : 0n;\n message.attestation_type = object.attestation_type ?? 0;\n message.chain_id = object.chain_id ?? \"\";\n message.intended_wallet = object.intended_wallet ?? \"\";\n message.case_id = object.case_id ?? \"\";\n message.policy_version = object.policy_version ?? \"\";\n message.nonce = object.nonce ?? \"\";\n message.uniqueness_reference = object.uniqueness_reference ?? \"\";\n message.issued_at = object.issued_at ?? undefined;\n message.expires_at = object.expires_at ?? undefined;\n message.consumed = object.consumed ?? false;\n message.signature = object.signature ?? \"\";\n message.citizen_id = (object.citizen_id !== undefined && object.citizen_id !== null)\n ? BigInt(object.citizen_id)\n : 0n;\n message.old_wallet = object.old_wallet ?? \"\";\n message.new_wallet = object.new_wallet ?? \"\";\n return message;\n },\n};\n\nfunction createBaseApplication(): Application {\n return {\n application_id: \"\",\n applicant_wallet: \"\",\n status: 0,\n attestation_id: \"\",\n uniqueness_commitment: \"\",\n policy_version: \"\",\n decision_reason_code: \"\",\n submitted_at: undefined,\n decided_at: undefined,\n };\n}\n\nexport const Application: MessageFns<Application> = {\n encode(message: Application, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.application_id !== \"\") {\n writer.uint32(10).string(message.application_id);\n }\n if (message.applicant_wallet !== \"\") {\n writer.uint32(18).string(message.applicant_wallet);\n }\n if (message.status !== 0) {\n writer.uint32(24).int32(message.status);\n }\n if (message.attestation_id !== \"\") {\n writer.uint32(34).string(message.attestation_id);\n }\n if (message.uniqueness_commitment !== \"\") {\n writer.uint32(42).string(message.uniqueness_commitment);\n }\n if (message.policy_version !== \"\") {\n writer.uint32(50).string(message.policy_version);\n }\n if (message.decision_reason_code !== \"\") {\n writer.uint32(58).string(message.decision_reason_code);\n }\n if (message.submitted_at !== undefined) {\n Timestamp.encode(toTimestamp(message.submitted_at), writer.uint32(66).fork()).join();\n }\n if (message.decided_at !== undefined) {\n Timestamp.encode(toTimestamp(message.decided_at), writer.uint32(74).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): Application {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseApplication();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.application_id = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.applicant_wallet = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.status = reader.int32() as any;\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.attestation_id = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 42) {\n break;\n }\n\n message.uniqueness_commitment = reader.string();\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.policy_version = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.decision_reason_code = reader.string();\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.submitted_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 9: {\n if (tag !== 74) {\n break;\n }\n\n message.decided_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<Application>): Application {\n return Application.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<Application>): Application {\n const message = createBaseApplication();\n message.application_id = object.application_id ?? \"\";\n message.applicant_wallet = object.applicant_wallet ?? \"\";\n message.status = object.status ?? 0;\n message.attestation_id = object.attestation_id ?? \"\";\n message.uniqueness_commitment = object.uniqueness_commitment ?? \"\";\n message.policy_version = object.policy_version ?? \"\";\n message.decision_reason_code = object.decision_reason_code ?? \"\";\n message.submitted_at = object.submitted_at ?? undefined;\n message.decided_at = object.decided_at ?? undefined;\n return message;\n },\n};\n\nfunction createBaseRecoveryAttestationCase(): RecoveryAttestationCase {\n return {\n recovery_case_id: \"\",\n applicant_wallet: \"\",\n status: 0,\n attestation_id: \"\",\n citizen_id: 0n,\n old_wallet: \"\",\n new_wallet: \"\",\n policy_version: \"\",\n decision_reason_code: \"\",\n submitted_at: undefined,\n decided_at: undefined,\n };\n}\n\nexport const RecoveryAttestationCase: MessageFns<RecoveryAttestationCase> = {\n encode(message: RecoveryAttestationCase, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {\n if (message.recovery_case_id !== \"\") {\n writer.uint32(10).string(message.recovery_case_id);\n }\n if (message.applicant_wallet !== \"\") {\n writer.uint32(18).string(message.applicant_wallet);\n }\n if (message.status !== 0) {\n writer.uint32(24).int32(message.status);\n }\n if (message.attestation_id !== \"\") {\n writer.uint32(34).string(message.attestation_id);\n }\n if (message.citizen_id !== 0n) {\n if (BigInt.asUintN(64, message.citizen_id) !== message.citizen_id) {\n throw new globalThis.Error(\"value provided for field message.citizen_id of type uint64 too large\");\n }\n writer.uint32(40).uint64(message.citizen_id);\n }\n if (message.old_wallet !== \"\") {\n writer.uint32(50).string(message.old_wallet);\n }\n if (message.new_wallet !== \"\") {\n writer.uint32(58).string(message.new_wallet);\n }\n if (message.policy_version !== \"\") {\n writer.uint32(66).string(message.policy_version);\n }\n if (message.decision_reason_code !== \"\") {\n writer.uint32(74).string(message.decision_reason_code);\n }\n if (message.submitted_at !== undefined) {\n Timestamp.encode(toTimestamp(message.submitted_at), writer.uint32(82).fork()).join();\n }\n if (message.decided_at !== undefined) {\n Timestamp.encode(toTimestamp(message.decided_at), writer.uint32(90).fork()).join();\n }\n return writer;\n },\n\n decode(input: BinaryReader | Uint8Array, length?: number): RecoveryAttestationCase {\n const reader = input instanceof BinaryReader ? input : new BinaryReader(input);\n const end = length === undefined ? reader.len : reader.pos + length;\n const message = createBaseRecoveryAttestationCase();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (tag !== 10) {\n break;\n }\n\n message.recovery_case_id = reader.string();\n continue;\n }\n case 2: {\n if (tag !== 18) {\n break;\n }\n\n message.applicant_wallet = reader.string();\n continue;\n }\n case 3: {\n if (tag !== 24) {\n break;\n }\n\n message.status = reader.int32() as any;\n continue;\n }\n case 4: {\n if (tag !== 34) {\n break;\n }\n\n message.attestation_id = reader.string();\n continue;\n }\n case 5: {\n if (tag !== 40) {\n break;\n }\n\n message.citizen_id = reader.uint64() as bigint;\n continue;\n }\n case 6: {\n if (tag !== 50) {\n break;\n }\n\n message.old_wallet = reader.string();\n continue;\n }\n case 7: {\n if (tag !== 58) {\n break;\n }\n\n message.new_wallet = reader.string();\n continue;\n }\n case 8: {\n if (tag !== 66) {\n break;\n }\n\n message.policy_version = reader.string();\n continue;\n }\n case 9: {\n if (tag !== 74) {\n break;\n }\n\n message.decision_reason_code = reader.string();\n continue;\n }\n case 10: {\n if (tag !== 82) {\n break;\n }\n\n message.submitted_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n case 11: {\n if (tag !== 90) {\n break;\n }\n\n message.decided_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));\n continue;\n }\n }\n if ((tag & 7) === 4 || tag === 0) {\n break;\n }\n reader.skip(tag & 7);\n }\n return message;\n },\n\n create(base?: DeepPartial<RecoveryAttestationCase>): RecoveryAttestationCase {\n return RecoveryAttestationCase.fromPartial(base ?? {});\n },\n fromPartial(object: DeepPartial<RecoveryAttestationCase>): RecoveryAttestationCase {\n const message = createBaseRecoveryAttestationCase();\n message.recovery_case_id = object.recovery_case_id ?? \"\";\n message.applicant_wallet = object.applicant_wallet ?? \"\";\n message.status = object.status ?? 0;\n message.attestation_id = object.attestation_id ?? \"\";\n message.citizen_id = (object.citizen_id !== undefined && object.citizen_id !== null)\n ? BigInt(object.citizen_id)\n : 0n;\n message.old_wallet = object.old_wallet ?? \"\";\n message.new_wallet = object.new_wallet ?? \"\";\n message.policy_version = object.policy_version ?? \"\";\n message.decision_reason_code = object.decision_reason_code ?? \"\";\n message.submitted_at = object.submitted_at ?? undefined;\n message.decided_at = object.decided_at ?? undefined;\n return message;\n },\n};\n\ntype Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;\n\ntype DeepPartial<T> = T extends bigint ? string | number | bigint\n : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>\n : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>\n : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }\n : Partial<T>;\n\nfunction toTimestamp(date: Date): Timestamp {\n const seconds = BigInt(Math.trunc(date.getTime() / 1_000));\n const nanos = (date.getTime() % 1_000) * 1_000_000;\n return { seconds, nanos };\n}\n\nfunction fromTimestamp(t: Timestamp): Date {\n let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1_000;\n millis += (t.nanos || 0) / 1_000_000;\n return new globalThis.Date(millis);\n}\n\ninterface MessageFns<T> {\n encode(message: T, writer?: BinaryWriter): BinaryWriter;\n decode(input: BinaryReader | Uint8Array, length?: number): T;\n create(base?: DeepPartial<T>): T;\n fromPartial(object: DeepPartial<T>): T;\n}\n","import { GeneratedType, Registry } from \"@cosmjs/proto-signing\";\nimport { defaultRegistryTypes } from \"@cosmjs/stargate\";\nimport { BinaryWriter } from \"@bufbuild/protobuf/wire\";\n\nimport {\n MsgApproveRecovery,\n MsgCancelRecovery,\n MsgFinalizeRecovery,\n MsgInitiateRecovery,\n MsgIssueKCP,\n MsgReactivateKCP,\n MsgRevokeKCP,\n MsgSuspendKCP,\n} from \"./generated/isatheword/kingdomchain/citizen/v1/tx\";\nimport {\n MsgDecideApplication,\n MsgDecideRecoveryAttestation,\n MsgRegisterProvider,\n MsgSubmitApplication,\n MsgSubmitRecoveryAttestation,\n MsgSuspendProvider,\n} from \"./generated/isatheword/kingdomchain/compliance/v1/tx\";\n\ninterface MessageFns<T> {\n encode(message: T, writer?: BinaryWriter): BinaryWriter;\n decode(input: Uint8Array): T;\n fromPartial(object: Partial<T>): T;\n}\n\n/** Adapt ts-proto @bufbuild MessageFns to CosmJS Registry (encode().finish()). */\nfunction wrapMsgFns<T>(msgFns: MessageFns<T>): GeneratedType {\n return {\n encode: (message: T) => msgFns.encode(message) as any,\n decode: (input: Uint8Array) => msgFns.decode(input),\n fromPartial: (object: Partial<T>) => msgFns.fromPartial(object),\n };\n}\n\nconst COMPLIANCE_MSG_TYPES: ReadonlyArray<[string, GeneratedType]> = [\n [\"/isatheword.kingdomchain.compliance.v1.MsgRegisterProvider\", wrapMsgFns(MsgRegisterProvider)],\n [\"/isatheword.kingdomchain.compliance.v1.MsgSuspendProvider\", wrapMsgFns(MsgSuspendProvider)],\n [\"/isatheword.kingdomchain.compliance.v1.MsgSubmitApplication\", wrapMsgFns(MsgSubmitApplication)],\n [\"/isatheword.kingdomchain.compliance.v1.MsgSubmitRecoveryAttestation\", wrapMsgFns(MsgSubmitRecoveryAttestation)],\n [\"/isatheword.kingdomchain.compliance.v1.MsgDecideApplication\", wrapMsgFns(MsgDecideApplication)],\n [\"/isatheword.kingdomchain.compliance.v1.MsgDecideRecoveryAttestation\", wrapMsgFns(MsgDecideRecoveryAttestation)],\n];\n\nconst CITIZEN_MSG_TYPES: ReadonlyArray<[string, GeneratedType]> = [\n [\"/isatheword.kingdomchain.citizen.v1.MsgIssueKCP\", wrapMsgFns(MsgIssueKCP)],\n [\"/isatheword.kingdomchain.citizen.v1.MsgSuspendKCP\", wrapMsgFns(MsgSuspendKCP)],\n [\"/isatheword.kingdomchain.citizen.v1.MsgReactivateKCP\", wrapMsgFns(MsgReactivateKCP)],\n [\"/isatheword.kingdomchain.citizen.v1.MsgRevokeKCP\", wrapMsgFns(MsgRevokeKCP)],\n [\"/isatheword.kingdomchain.citizen.v1.MsgInitiateRecovery\", wrapMsgFns(MsgInitiateRecovery)],\n [\"/isatheword.kingdomchain.citizen.v1.MsgApproveRecovery\", wrapMsgFns(MsgApproveRecovery)],\n [\"/isatheword.kingdomchain.citizen.v1.MsgFinalizeRecovery\", wrapMsgFns(MsgFinalizeRecovery)],\n [\"/isatheword.kingdomchain.citizen.v1.MsgCancelRecovery\", wrapMsgFns(MsgCancelRecovery)],\n];\n\n/** CosmJS registry: standard Cosmos SDK types + Kingdom Chain citizen/compliance messages. */\nexport function createKingdomChainRegistry(): Registry {\n return new Registry([...defaultRegistryTypes, ...COMPLIANCE_MSG_TYPES, ...CITIZEN_MSG_TYPES]);\n}\n\nexport { MsgSubmitApplication, MsgSubmitRecoveryAttestation } from \"./generated/isatheword/kingdomchain/compliance/v1/tx\";\nexport { ApplicationStatus, RecoveryAttestationStatus } from \"./generated/isatheword/kingdomchain/compliance/v1/compliance\";\n","/**\n * Kingdom Chain on-chain denom and display metadata.\n *\n * Sources:\n * - x/supply/types/constants.go (UkdrDenom = \"ukdr\")\n * - TOKENOMICS_COSMOS_SPEC.md (1 KDR = 1,000,000 ukdr)\n * - app/app.go + app/config.go (bech32 prefix, coin type)\n */\n\n/** Base (minimal) denom registered in x/supply. */\nexport const UKDR_MINIMAL_DENOM = \"ukdr\";\n\n/** Human-readable display symbol. */\nexport const UKDR_DISPLAY_DENOM = \"KDR\";\n\n/** ukdr is a micro-unit: 10^6 ukdr = 1 KDR. */\nexport const UKDR_DECIMALS = 6;\n\n/** Account / validator bech32 prefix (AccountAddressPrefix in app/app.go). */\nexport const BECH32_PREFIX = \"king\";\n\n/** SLIP-0044 coin type (ChainCoinType in app/app.go). */\nexport const CHAIN_COIN_TYPE = 118;\n\n/** Devnet default chain ID (override via env when a permanent node exists). */\nexport const DEFAULT_CHAIN_ID = \"kingdomchain-e2e\";\n\nexport const DEFAULT_RPC_URL = \"http://127.0.0.1:26657\";\nexport const DEFAULT_REST_URL = \"http://127.0.0.1:1317\";\n","import type { OfflineDirectSigner } from \"@cosmjs/proto-signing\";\nimport { SigningStargateClient } from \"@cosmjs/stargate\";\n\nimport {\n BECH32_PREFIX,\n CHAIN_COIN_TYPE,\n UKDR_DECIMALS,\n UKDR_DISPLAY_DENOM,\n UKDR_MINIMAL_DENOM,\n} from \"./chainConstants\";\nimport { createKingdomChainRegistry } from \"./registry\";\n\n/** Keplr/Leap-compatible currency entry. */\nexport interface ChainCurrency {\n coinDenom: string;\n coinMinimalDenom: string;\n coinDecimals: number;\n gasPriceStep?: { low: number; average: number; high: number };\n}\n\n/** Keplr/Leap-compatible ChainInfo for experimentalSuggestChain. */\nexport interface ChainInfo {\n chainId: string;\n chainName: string;\n rpc: string;\n rest: string;\n bip44: { coinType: number };\n bech32Config: {\n bech32PrefixAccAddr: string;\n bech32PrefixAccPub: string;\n bech32PrefixValAddr: string;\n bech32PrefixValPub: string;\n bech32PrefixConsAddr: string;\n bech32PrefixConsPub: string;\n };\n currencies: ChainCurrency[];\n feeCurrencies: ChainCurrency[];\n stakeCurrency: ChainCurrency;\n}\n\n/** Subset of Keplr/Leap window API used for chain connect. */\nexport interface BrowserWalletApi {\n experimentalSuggestChain(chainInfo: ChainInfo): Promise<void>;\n enable(chainId: string): Promise<void>;\n getOfflineSigner(chainId: string): OfflineDirectSigner;\n}\n\nexport class WalletNotInstalledError extends Error {\n constructor(public readonly walletName: string) {\n super(`${walletName} extension is not installed. Install it and refresh the page.`);\n this.name = \"WalletNotInstalledError\";\n }\n}\n\nexport class WalletConnectionError extends Error {\n constructor(\n public readonly walletName: string,\n public readonly step: \"suggestChain\" | \"enable\" | \"getOfflineSigner\",\n cause?: unknown,\n ) {\n const stepLabel =\n step === \"suggestChain\"\n ? \"chain suggestion\"\n : step === \"enable\"\n ? \"connection request\"\n : \"offline signer retrieval\";\n super(`${walletName} failed during ${stepLabel}.`, { cause });\n this.name = \"WalletConnectionError\";\n }\n}\n\n/** @deprecated Use WalletConnectionError — kept for backward compatibility in tests/demo. */\nexport class WalletConnectionRejectedError extends WalletConnectionError {\n constructor(walletName: string, step: \"suggestChain\" | \"enable\", cause?: unknown) {\n super(walletName, step, cause);\n this.name = \"WalletConnectionRejectedError\";\n }\n}\n\nexport class WalletAccountError extends Error {\n constructor(public readonly walletName: string) {\n super(`${walletName} returned no usable accounts. Reconnect the wallet and try again.`);\n this.name = \"WalletAccountError\";\n }\n}\n\nexport class InvalidChainConfigError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"InvalidChainConfigError\";\n }\n}\n\nexport class RpcConnectionError extends Error {\n constructor(\n public readonly rpcUrl: string,\n cause?: unknown,\n ) {\n super(`Failed to connect to RPC endpoint ${rpcUrl}. Is the node running and reachable?`, { cause });\n this.name = \"RpcConnectionError\";\n }\n}\n\ndeclare global {\n interface Window {\n keplr?: BrowserWalletApi;\n leap?: BrowserWalletApi;\n }\n}\n\nconst UKDR_CURRENCY: ChainCurrency = {\n coinDenom: UKDR_DISPLAY_DENOM,\n coinMinimalDenom: UKDR_MINIMAL_DENOM,\n coinDecimals: UKDR_DECIMALS,\n};\n\n/** E2E devnet uses minimum-gas-prices = \"0ukdr\" (scripts/citizen-compliance-e2e/run.sh). */\nconst UKDR_FEE_CURRENCY: ChainCurrency = {\n ...UKDR_CURRENCY,\n gasPriceStep: { low: 0, average: 0, high: 0.025 },\n};\n\nfunction isWalletApiPresent(api: unknown): api is BrowserWalletApi {\n if (api == null || typeof api !== \"object\") {\n return false;\n }\n const candidate = api as BrowserWalletApi;\n return (\n typeof candidate.experimentalSuggestChain === \"function\" &&\n typeof candidate.enable === \"function\" &&\n typeof candidate.getOfflineSigner === \"function\"\n );\n}\n\n/** Validate chain endpoint inputs before passing to Keplr/Leap. */\nexport function validateChainConfig(chainId: string, rpcUrl: string, restUrl: string): void {\n if (!chainId.trim()) {\n throw new InvalidChainConfigError(\"chainId is required\");\n }\n if (!rpcUrl.trim()) {\n throw new InvalidChainConfigError(\"rpcUrl is required\");\n }\n if (!restUrl.trim()) {\n throw new InvalidChainConfigError(\"restUrl is required\");\n }\n}\n\nexport function isKeplrAvailable(): boolean {\n return typeof window !== \"undefined\" && isWalletApiPresent(window.keplr);\n}\n\nexport function isLeapAvailable(): boolean {\n return typeof window !== \"undefined\" && isWalletApiPresent(window.leap);\n}\n\n/** Build ChainInfo for Keplr/Leap experimentalSuggestChain. */\nexport function buildKingdomChainInfo(\n chainId: string,\n rpcUrl: string,\n restUrl: string,\n chainName = \"Kingdom Chain\",\n): ChainInfo {\n validateChainConfig(chainId, rpcUrl, restUrl);\n\n const accPub = `${BECH32_PREFIX}pub`;\n const valAddr = `${BECH32_PREFIX}valoper`;\n const valPub = `${BECH32_PREFIX}valoperpub`;\n const consAddr = `${BECH32_PREFIX}valcons`;\n const consPub = `${BECH32_PREFIX}valconspub`;\n\n return {\n chainId,\n chainName,\n rpc: rpcUrl,\n rest: restUrl,\n bip44: { coinType: CHAIN_COIN_TYPE },\n bech32Config: {\n bech32PrefixAccAddr: BECH32_PREFIX,\n bech32PrefixAccPub: accPub,\n bech32PrefixValAddr: valAddr,\n bech32PrefixValPub: valPub,\n bech32PrefixConsAddr: consAddr,\n bech32PrefixConsPub: consPub,\n },\n currencies: [UKDR_CURRENCY],\n feeCurrencies: [UKDR_FEE_CURRENCY],\n stakeCurrency: UKDR_CURRENCY,\n };\n}\n\nasync function assertSignerHasAccount(signer: OfflineDirectSigner, walletName: string): Promise<void> {\n let accounts;\n try {\n accounts = await signer.getAccounts();\n } catch (err) {\n throw new WalletConnectionError(walletName, \"getOfflineSigner\", err);\n }\n if (accounts.length === 0 || !accounts[0]?.address?.trim()) {\n throw new WalletAccountError(walletName);\n }\n}\n\n/** Suggest chain, request access, return CosmJS OfflineDirectSigner. */\nexport async function suggestAndConnect(\n walletApi: BrowserWalletApi,\n chainInfo: ChainInfo,\n walletName = \"Wallet\",\n): Promise<OfflineDirectSigner> {\n try {\n await walletApi.experimentalSuggestChain(chainInfo);\n } catch (err) {\n throw new WalletConnectionRejectedError(walletName, \"suggestChain\", err);\n }\n\n try {\n await walletApi.enable(chainInfo.chainId);\n } catch (err) {\n throw new WalletConnectionRejectedError(walletName, \"enable\", err);\n }\n\n let signer: OfflineDirectSigner;\n try {\n signer = walletApi.getOfflineSigner(chainInfo.chainId);\n } catch (err) {\n throw new WalletConnectionError(walletName, \"getOfflineSigner\", err);\n }\n\n await assertSignerHasAccount(signer, walletName);\n return signer;\n}\n\nfunction resolveWalletApi(\n getter: () => BrowserWalletApi | undefined,\n walletName: string,\n): BrowserWalletApi {\n if (!isWalletApiPresent(getter())) {\n throw new WalletNotInstalledError(walletName);\n }\n const api = getter();\n if (!isWalletApiPresent(api)) {\n throw new WalletNotInstalledError(walletName);\n }\n return api;\n}\n\nexport async function connectKeplr(chainInfo: ChainInfo): Promise<OfflineDirectSigner> {\n const api = resolveWalletApi(() => window.keplr, \"Keplr\");\n return suggestAndConnect(api, chainInfo, \"Keplr\");\n}\n\nexport async function connectLeap(chainInfo: ChainInfo): Promise<OfflineDirectSigner> {\n const api = resolveWalletApi(() => window.leap, \"Leap\");\n return suggestAndConnect(api, chainInfo, \"Leap\");\n}\n\n/** SigningStargateClient wired with Kingdom Chain custom message registry. */\nexport async function createBrowserSigningClient(\n rpcUrl: string,\n signer: OfflineDirectSigner,\n): Promise<SigningStargateClient> {\n if (!rpcUrl.trim()) {\n throw new InvalidChainConfigError(\"rpcUrl is required\");\n }\n try {\n return await SigningStargateClient.connectWithSigner(rpcUrl, signer, {\n registry: createKingdomChainRegistry(),\n });\n } catch (err) {\n throw new RpcConnectionError(rpcUrl, err);\n }\n}\n","import type { EncodeObject } from \"@cosmjs/proto-signing\";\n\nimport {\n ATTESTATION_TYPE_CITIZENSHIP_APPLICATION,\n attestationSignPayload,\n providerSeedFromHex,\n signAttestationPayload,\n type AttestationPayloadInput,\n} from \"./attestation\";\nimport { MsgSubmitApplication } from \"./registry\";\n\nexport interface SubmitApplicationParams {\n applicantWallet: string;\n applicationId: string;\n chainId: string;\n providerId: string;\n policyVersion: string;\n providerSeedHex: string;\n nonce: string;\n uniquenessReference: string;\n issuedAt: Date;\n expiresAt: Date;\n providerKeyVersion?: bigint;\n}\n\nexport function buildSubmitApplicationMsg(\n applicantWallet: string,\n applicationId: string,\n attestationInput: AttestationPayloadInput,\n signature: string,\n): EncodeObject {\n return {\n typeUrl: \"/isatheword.kingdomchain.compliance.v1.MsgSubmitApplication\",\n value: MsgSubmitApplication.fromPartial({\n applicant_wallet: applicantWallet,\n application_id: applicationId,\n provider_id: attestationInput.providerId,\n provider_key_version: attestationInput.providerKeyVersion,\n chain_id: attestationInput.chainId,\n case_id: attestationInput.caseId,\n policy_version: attestationInput.policyVersion,\n nonce: attestationInput.nonce,\n uniqueness_reference: attestationInput.uniquenessReference,\n issued_at: attestationInput.issuedAt,\n expires_at: attestationInput.expiresAt,\n signature,\n }),\n };\n}\n\nexport async function signCitizenshipAttestation(\n params: SubmitApplicationParams,\n): Promise<{ signature: string; input: AttestationPayloadInput }> {\n const input: AttestationPayloadInput = {\n attestationType: ATTESTATION_TYPE_CITIZENSHIP_APPLICATION,\n chainId: params.chainId,\n intendedWallet: params.applicantWallet,\n caseId: params.applicationId,\n policyVersion: params.policyVersion,\n nonce: params.nonce,\n uniquenessReference: params.uniquenessReference,\n issuedAt: params.issuedAt,\n expiresAt: params.expiresAt,\n providerId: params.providerId,\n providerKeyVersion: params.providerKeyVersion ?? 1n,\n };\n const payload = attestationSignPayload(input);\n const providerSeed = providerSeedFromHex(params.providerSeedHex);\n const signature = await signAttestationPayload(providerSeed, payload);\n return { signature, input };\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@kingdomchain/wallet-client",
3
+ "version": "0.1.0",
4
+ "description": "Kingdom Chain browser wallet + CosmJS client for citizenship applications and recovery attestations",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "sideEffects": false,
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/isatheword/kingdomchain.git",
25
+ "directory": "clients/ts"
26
+ },
27
+ "keywords": [
28
+ "cosmos",
29
+ "cosmjs",
30
+ "keplr",
31
+ "leap",
32
+ "kingdom-chain",
33
+ "wallet"
34
+ ],
35
+ "scripts": {
36
+ "codegen": "cd ../.. && buf generate --template clients/ts/buf.gen.yaml --path proto/isatheword/kingdomchain",
37
+ "build": "tsup",
38
+ "prepublishOnly": "npm run build",
39
+ "typecheck": "tsc --noEmit -p tsconfig.json",
40
+ "test": "vitest run",
41
+ "test:watch": "vitest",
42
+ "test:fuzz": "vitest run src/attestation.test.ts",
43
+ "test:mutate": "stryker run",
44
+ "e2e:submit-application": "tsx scripts/submit-application-e2e.ts",
45
+ "e2e:submit-recovery": "tsx scripts/submit-recovery-e2e.ts",
46
+ "demo": "vite --config demo/vite.config.ts"
47
+ },
48
+ "dependencies": {
49
+ "@bufbuild/protobuf": "^2.2.3",
50
+ "@cosmjs/amino": "^0.32.4",
51
+ "@cosmjs/crypto": "^0.32.4",
52
+ "@cosmjs/encoding": "^0.32.4",
53
+ "@cosmjs/proto-signing": "^0.32.4",
54
+ "@cosmjs/stargate": "^0.32.4",
55
+ "@cosmjs/tendermint-rpc": "^0.32.4",
56
+ "@noble/ed25519": "^2.2.3",
57
+ "@noble/hashes": "^1.8.0"
58
+ },
59
+ "devDependencies": {
60
+ "@stryker-mutator/core": "^8.7.1",
61
+ "@stryker-mutator/vitest-runner": "^8.7.1",
62
+ "@types/node": "^22.10.0",
63
+ "fast-check": "^3.23.2",
64
+ "protobufjs": "^7.6.5",
65
+ "ts-proto": "^2.6.1",
66
+ "tsup": "^8.5.0",
67
+ "tsx": "^4.19.2",
68
+ "typescript": "^5.7.2",
69
+ "vite": "^6.0.7",
70
+ "vitest": "^3.0.5"
71
+ }
72
+ }