@qorechain/sdk 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -2266,13 +2266,15 @@ declare function withRetry<T>(fn: (attempt: number) => Promise<T>, opts?: RetryO
2266
2266
  * / {@link signAndBroadcastHybrid}) — prefer those for end-to-end signing. This
2267
2267
  * module documents the on-wire encoding the chain reads:
2268
2268
  *
2269
- * - `PQCHybridSignature` struct, JSON field tags (`algorithm_id`,
2270
- * `pqc_signature`, `pqc_public_key,omitempty`), and type URL
2269
+ * - `PQCHybridSignature` protobuf message (fields `algorithm_id` = 1,
2270
+ * `pqc_signature` = 2, `pqc_public_key` = 3) and type URL
2271
2271
  * `/qorechain.pqc.v1.PQCHybridSignature`.
2272
- * - The ante handler extracts the extension by type URL and JSON-decodes it, so
2273
- * the `Any.value` carries the struct's Go-JSON encoding (Go marshals
2274
- * `[]byte` as standard padded base64 strings), NOT a protobuf message. This
2275
- * module encodes accordingly (see {@link toGoJson}).
2272
+ * - The ante handler extracts the extension by type URL and PROTOBUF-decodes it,
2273
+ * so the `Any.value` carries the message's protobuf encoding (via the
2274
+ * generated `PQCHybridSignature` codec), NOT JSON. Its first byte is `0x08`
2275
+ * (field-1 varint tag). A prior release JSON-encoded this value; the chain's
2276
+ * tx decoder rejected every such tx at CheckTx (the leading `0x7b` = `{` was
2277
+ * misread as field 15 `start_group`). Verified live on testnet 2026-07-05.
2276
2278
  * - PLACEMENT: the extension is a CRITICAL extension option — it goes in
2277
2279
  * `TxBody.extension_options`. {@link buildHybridTx} always uses this slot.
2278
2280
  * This module additionally exposes `non_critical_extension_options` via
@@ -2306,9 +2308,11 @@ interface AttachHybridOptions {
2306
2308
  * `TxBody` extension option.
2307
2309
  *
2308
2310
  * The `Any.typeUrl` is the core {@link HYBRID_SIG_TYPE_URL}; the `Any.value` is
2309
- * the UTF-8 bytes of the struct's Go-JSON encoding (see {@link toGoJson} and the
2310
- * module header the chain reads this extension by type URL + JSON decoding,
2311
- * not protobuf).
2311
+ * the PROTOBUF encoding of the `PQCHybridSignature` message (via the generated
2312
+ * codecfields `algorithmId` = 1, `pqcSignature` = 2, `pqcPublicKey` = 3), so
2313
+ * the encoded value always begins with `0x08` (field-1 varint tag). The chain's
2314
+ * ante handler protobuf-decodes this extension; a JSON-encoded value is rejected
2315
+ * by the tx decoder at CheckTx.
2312
2316
  */
2313
2317
  declare function encodeHybridExtension(ext: PQCHybridSignature$1): Any;
2314
2318
  /**
@@ -2349,9 +2353,11 @@ declare function attachHybridExtension(body: TxBody, ext: PQCHybridSignature$1,
2349
2353
  * ML-DSA-87, empty context) — 4627 bytes for Dilithium-5.
2350
2354
  * - The `PQCHybridSignature` extension is then added to
2351
2355
  * `TxBody.extension_options` (CRITICAL extension options) as an `Any` with
2352
- * `type_url = "/qorechain.pqc.v1.PQCHybridSignature"` and `value` = UTF-8
2353
- * bytes of the Go-JSON `{ "algorithm_id", "pqc_signature", "pqc_public_key"? }`
2354
- * (standard padded base64; `pqc_public_key` omitted when not provided).
2356
+ * `type_url = "/qorechain.pqc.v1.PQCHybridSignature"` and `value` = the
2357
+ * PROTOBUF encoding of the `PQCHybridSignature` message (fields
2358
+ * `algorithm_id` = 1, `pqc_signature` = 2, `pqc_public_key` = 3; the encoded
2359
+ * value begins with `0x08`). The chain protobuf-decodes it — a JSON value is
2360
+ * rejected by the tx decoder.
2355
2361
  * - The CLASSICAL signature is computed normally (SIGN_MODE_DIRECT) over the
2356
2362
  * FINAL body (the one WITH the PQC extension) + authInfo + chainId +
2357
2363
  * accountNumber, and goes in `TxRaw.signatures` (outside the body). There is
@@ -9462,6 +9468,6 @@ declare function migrateToHybrid(tx: TxClient, opts: MigrateToHybridOptions): Pr
9462
9468
  * callers who want to compose them directly. Internal helpers are not exported.
9463
9469
  */
9464
9470
  /** SDK version. */
9465
- declare const VERSION = "0.6.0";
9471
+ declare const VERSION = "0.6.1";
9466
9472
 
9467
9473
  export { type AbstractAccountQueryClient, type Account, type AccountSequence, AlgorithmDilithium5, type AlgorithmID, AlgorithmMLKEM1024, AlgorithmUnspecified, type AllBalancesResponse, type AmmQueryClient, type AnchorStateOptions, type AttachHybridOptions, type AutoFeeOptions, type BalanceResponse, type BankSendOptions, type Bech32Config, type Bech32Prefixes, type BridgeQueryClient, type BroadcastMode, type BroadcastResult, type BuildHybridTxOptions, type BuiltHybridTx, type CallOptions, type ChallengeBatchOptions, type ClientFees, type CoinInfo, type ConnectPhantomUnifiedOptions, type ConnectTxOptions, type ContractMsg, type CosmWasmPayload, type CosmWasmReadClient, type CosmWasmSigningClient, type CosmosWalletConnection, type CosmosWalletName, type CreateClientOptions, type CreateCrossVMClientOptions, type CreateMultilayerClientOptions, type CreateRollupClientOptions, type CreateRollupOptions, type CrossVMAtomicResult, type CrossVMCallBase, type CrossVMCallOptions, type CrossVMCallResult, type CrossVMClient, type CrossVMWriteOptions, type CrossVmMessage, type CrossVmMessageResponse, type CrossVmParamsResponse, type CrossVmQueryClient, DEFAULT_GAS_MULTIPLIER, DEFAULT_GAS_PRICE, type DecodedTxError, type DenomOptions, type DerivationOptions, ETHSECP256K1_PUBKEY_TYPE, type Ed25519Account, type EnsurePqcRegisteredOptions, type EnsurePqcRegisteredResult, type EstimateFeeOptions, type EthBroadcaster, EthNativeSigner, type EthNativeSignerOptions, type EthSignParams, type EthSigningKey, type EthTxParams, type EventFilters, type EventStream, type EvmPayload, type ExecuteWithdrawalOptions, type ExplorerConfig, type FaucetConfig, type FeeInput, type FeeUrgency, type FetchLike, GasPrice, type GetBlockResponse, type GetCosmosWalletOptions, type GetJsonOptions, type GetTxFn, type GetTxResponse, HYBRID_SIG_TYPE_URL, type Handler, type HashInput, type HttpOptions, type HybridBroadcaster, type HybridPlacement, type HybridSendPath, HybridSigner, type IncludedTx, type InjectedCosmosWallet, type InstantiateOpts, JsonRpcClient, type JsonRpcClientOptions, JsonRpcError, type JsonRpcErrorObject, type JsonRpcResponse, type KeplrChainInfo, type KeplrCurrency, type KeplrFeeCurrency, type KeyType, type LicenseQueryClient, type LightNodeQueryClient, ML_DSA_87_PUBLIC_KEY_LENGTH, ML_DSA_87_SECRET_KEY_LENGTH, ML_DSA_87_SEED_LENGTH, ML_DSA_87_SIGNATURE_LENGTH, MSG_SEND_TYPE_URL, type MigratePqcKeyOptions, type MigrateToHybridOptions, type MultilayerClient, type MultilayerQueryClient, type MultilayerWriteOptions, NETWORKS, type NetworkConfig, type NetworkEndpoints, type NetworkName, type NewBlockEventLike, PHANTOM_DERIVATION_DOMAIN, type PQCHybridSignature$1 as PQCHybridSignature, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, type PageResponse, type PaginatedOptions, type Pagination, type ParsedAccountAuth, type PayloadInput, type PendingCrossVmMessagesResponse, type PhantomProvider, type PqcKeypair, type PqcQueryClient, type PqcSignaturePart, PqcSigner, type PqcStatus, type PqcStatusSource, type QcaQueryClient, QorClient, type QoreChainClient, type QoreChainQueryClients, QoreHttpError, QoreTxError, type QueryValue, type RawPayload, type RdkQueryClient, type RegisterPaychainOptions, type RegisterSidechainOptions, type ReputationQueryClient, type RequestFaucetOptions, type ResolveChallengeOptions, RestClient, type RestClientOptions, type RetryOptions, type RlConsensusQueryClient, type RollupClient, type RollupLifecycleOptions, type RollupWriteOptions, type RouteTransactionOptions, STATIC_FALLBACK, type SearchTxsOptions, type SearchTxsResponse, type Secp256k1Account, type SignAndBroadcastHybridOptions, type SignAndBroadcastOptions, type SignOutput, type SignatureMode, type SignedEthTx, type Signer, type SigningClientLike, type SimulateOptions, type SubmitBatchOptions, type SubscriptionClient, type SvmPayload, type SvmQueryClient, type SyncBroadcaster, TxClient, type TxClientOptions, type TxConnectOptions, type TxErrorInput, type TxEventLike, type FeeInput$1 as TxFeeInput, type TxOrderBy, type TxQueryFilters, type TxResultLike, type UnifiedAccount, type UnifiedAddresses, type Unsubscribe, VERSION, type VMType, VM_TYPES, type WaitForTxOptions, abstractaccount, accountAuthInfo, addressesFrom20, algorithmName, amm, attachHybridExtension, authz, bank, bech32ToHex, bridge, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmToQor, execute, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, ibc, instantiate, instantiate2, isChecksumAddress, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, index as qorechainTypes, queryContractSmart, rdk, requestFaucet, ripemd160, ripemd160Hex, rlconsensus, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry };
package/dist/index.d.ts CHANGED
@@ -2266,13 +2266,15 @@ declare function withRetry<T>(fn: (attempt: number) => Promise<T>, opts?: RetryO
2266
2266
  * / {@link signAndBroadcastHybrid}) — prefer those for end-to-end signing. This
2267
2267
  * module documents the on-wire encoding the chain reads:
2268
2268
  *
2269
- * - `PQCHybridSignature` struct, JSON field tags (`algorithm_id`,
2270
- * `pqc_signature`, `pqc_public_key,omitempty`), and type URL
2269
+ * - `PQCHybridSignature` protobuf message (fields `algorithm_id` = 1,
2270
+ * `pqc_signature` = 2, `pqc_public_key` = 3) and type URL
2271
2271
  * `/qorechain.pqc.v1.PQCHybridSignature`.
2272
- * - The ante handler extracts the extension by type URL and JSON-decodes it, so
2273
- * the `Any.value` carries the struct's Go-JSON encoding (Go marshals
2274
- * `[]byte` as standard padded base64 strings), NOT a protobuf message. This
2275
- * module encodes accordingly (see {@link toGoJson}).
2272
+ * - The ante handler extracts the extension by type URL and PROTOBUF-decodes it,
2273
+ * so the `Any.value` carries the message's protobuf encoding (via the
2274
+ * generated `PQCHybridSignature` codec), NOT JSON. Its first byte is `0x08`
2275
+ * (field-1 varint tag). A prior release JSON-encoded this value; the chain's
2276
+ * tx decoder rejected every such tx at CheckTx (the leading `0x7b` = `{` was
2277
+ * misread as field 15 `start_group`). Verified live on testnet 2026-07-05.
2276
2278
  * - PLACEMENT: the extension is a CRITICAL extension option — it goes in
2277
2279
  * `TxBody.extension_options`. {@link buildHybridTx} always uses this slot.
2278
2280
  * This module additionally exposes `non_critical_extension_options` via
@@ -2306,9 +2308,11 @@ interface AttachHybridOptions {
2306
2308
  * `TxBody` extension option.
2307
2309
  *
2308
2310
  * The `Any.typeUrl` is the core {@link HYBRID_SIG_TYPE_URL}; the `Any.value` is
2309
- * the UTF-8 bytes of the struct's Go-JSON encoding (see {@link toGoJson} and the
2310
- * module header the chain reads this extension by type URL + JSON decoding,
2311
- * not protobuf).
2311
+ * the PROTOBUF encoding of the `PQCHybridSignature` message (via the generated
2312
+ * codecfields `algorithmId` = 1, `pqcSignature` = 2, `pqcPublicKey` = 3), so
2313
+ * the encoded value always begins with `0x08` (field-1 varint tag). The chain's
2314
+ * ante handler protobuf-decodes this extension; a JSON-encoded value is rejected
2315
+ * by the tx decoder at CheckTx.
2312
2316
  */
2313
2317
  declare function encodeHybridExtension(ext: PQCHybridSignature$1): Any;
2314
2318
  /**
@@ -2349,9 +2353,11 @@ declare function attachHybridExtension(body: TxBody, ext: PQCHybridSignature$1,
2349
2353
  * ML-DSA-87, empty context) — 4627 bytes for Dilithium-5.
2350
2354
  * - The `PQCHybridSignature` extension is then added to
2351
2355
  * `TxBody.extension_options` (CRITICAL extension options) as an `Any` with
2352
- * `type_url = "/qorechain.pqc.v1.PQCHybridSignature"` and `value` = UTF-8
2353
- * bytes of the Go-JSON `{ "algorithm_id", "pqc_signature", "pqc_public_key"? }`
2354
- * (standard padded base64; `pqc_public_key` omitted when not provided).
2356
+ * `type_url = "/qorechain.pqc.v1.PQCHybridSignature"` and `value` = the
2357
+ * PROTOBUF encoding of the `PQCHybridSignature` message (fields
2358
+ * `algorithm_id` = 1, `pqc_signature` = 2, `pqc_public_key` = 3; the encoded
2359
+ * value begins with `0x08`). The chain protobuf-decodes it — a JSON value is
2360
+ * rejected by the tx decoder.
2355
2361
  * - The CLASSICAL signature is computed normally (SIGN_MODE_DIRECT) over the
2356
2362
  * FINAL body (the one WITH the PQC extension) + authInfo + chainId +
2357
2363
  * accountNumber, and goes in `TxRaw.signatures` (outside the body). There is
@@ -9462,6 +9468,6 @@ declare function migrateToHybrid(tx: TxClient, opts: MigrateToHybridOptions): Pr
9462
9468
  * callers who want to compose them directly. Internal helpers are not exported.
9463
9469
  */
9464
9470
  /** SDK version. */
9465
- declare const VERSION = "0.6.0";
9471
+ declare const VERSION = "0.6.1";
9466
9472
 
9467
9473
  export { type AbstractAccountQueryClient, type Account, type AccountSequence, AlgorithmDilithium5, type AlgorithmID, AlgorithmMLKEM1024, AlgorithmUnspecified, type AllBalancesResponse, type AmmQueryClient, type AnchorStateOptions, type AttachHybridOptions, type AutoFeeOptions, type BalanceResponse, type BankSendOptions, type Bech32Config, type Bech32Prefixes, type BridgeQueryClient, type BroadcastMode, type BroadcastResult, type BuildHybridTxOptions, type BuiltHybridTx, type CallOptions, type ChallengeBatchOptions, type ClientFees, type CoinInfo, type ConnectPhantomUnifiedOptions, type ConnectTxOptions, type ContractMsg, type CosmWasmPayload, type CosmWasmReadClient, type CosmWasmSigningClient, type CosmosWalletConnection, type CosmosWalletName, type CreateClientOptions, type CreateCrossVMClientOptions, type CreateMultilayerClientOptions, type CreateRollupClientOptions, type CreateRollupOptions, type CrossVMAtomicResult, type CrossVMCallBase, type CrossVMCallOptions, type CrossVMCallResult, type CrossVMClient, type CrossVMWriteOptions, type CrossVmMessage, type CrossVmMessageResponse, type CrossVmParamsResponse, type CrossVmQueryClient, DEFAULT_GAS_MULTIPLIER, DEFAULT_GAS_PRICE, type DecodedTxError, type DenomOptions, type DerivationOptions, ETHSECP256K1_PUBKEY_TYPE, type Ed25519Account, type EnsurePqcRegisteredOptions, type EnsurePqcRegisteredResult, type EstimateFeeOptions, type EthBroadcaster, EthNativeSigner, type EthNativeSignerOptions, type EthSignParams, type EthSigningKey, type EthTxParams, type EventFilters, type EventStream, type EvmPayload, type ExecuteWithdrawalOptions, type ExplorerConfig, type FaucetConfig, type FeeInput, type FeeUrgency, type FetchLike, GasPrice, type GetBlockResponse, type GetCosmosWalletOptions, type GetJsonOptions, type GetTxFn, type GetTxResponse, HYBRID_SIG_TYPE_URL, type Handler, type HashInput, type HttpOptions, type HybridBroadcaster, type HybridPlacement, type HybridSendPath, HybridSigner, type IncludedTx, type InjectedCosmosWallet, type InstantiateOpts, JsonRpcClient, type JsonRpcClientOptions, JsonRpcError, type JsonRpcErrorObject, type JsonRpcResponse, type KeplrChainInfo, type KeplrCurrency, type KeplrFeeCurrency, type KeyType, type LicenseQueryClient, type LightNodeQueryClient, ML_DSA_87_PUBLIC_KEY_LENGTH, ML_DSA_87_SECRET_KEY_LENGTH, ML_DSA_87_SEED_LENGTH, ML_DSA_87_SIGNATURE_LENGTH, MSG_SEND_TYPE_URL, type MigratePqcKeyOptions, type MigrateToHybridOptions, type MultilayerClient, type MultilayerQueryClient, type MultilayerWriteOptions, NETWORKS, type NetworkConfig, type NetworkEndpoints, type NetworkName, type NewBlockEventLike, PHANTOM_DERIVATION_DOMAIN, type PQCHybridSignature$1 as PQCHybridSignature, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, type PageResponse, type PaginatedOptions, type Pagination, type ParsedAccountAuth, type PayloadInput, type PendingCrossVmMessagesResponse, type PhantomProvider, type PqcKeypair, type PqcQueryClient, type PqcSignaturePart, PqcSigner, type PqcStatus, type PqcStatusSource, type QcaQueryClient, QorClient, type QoreChainClient, type QoreChainQueryClients, QoreHttpError, QoreTxError, type QueryValue, type RawPayload, type RdkQueryClient, type RegisterPaychainOptions, type RegisterSidechainOptions, type ReputationQueryClient, type RequestFaucetOptions, type ResolveChallengeOptions, RestClient, type RestClientOptions, type RetryOptions, type RlConsensusQueryClient, type RollupClient, type RollupLifecycleOptions, type RollupWriteOptions, type RouteTransactionOptions, STATIC_FALLBACK, type SearchTxsOptions, type SearchTxsResponse, type Secp256k1Account, type SignAndBroadcastHybridOptions, type SignAndBroadcastOptions, type SignOutput, type SignatureMode, type SignedEthTx, type Signer, type SigningClientLike, type SimulateOptions, type SubmitBatchOptions, type SubscriptionClient, type SvmPayload, type SvmQueryClient, type SyncBroadcaster, TxClient, type TxClientOptions, type TxConnectOptions, type TxErrorInput, type TxEventLike, type FeeInput$1 as TxFeeInput, type TxOrderBy, type TxQueryFilters, type TxResultLike, type UnifiedAccount, type UnifiedAddresses, type Unsubscribe, VERSION, type VMType, VM_TYPES, type WaitForTxOptions, abstractaccount, accountAuthInfo, addressesFrom20, algorithmName, amm, attachHybridExtension, authz, bank, bech32ToHex, bridge, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmToQor, execute, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, ibc, instantiate, instantiate2, isChecksumAddress, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, index as qorechainTypes, queryContractSmart, rdk, requestFaucet, ripemd160, ripemd160Hex, rlconsensus, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry };
package/dist/index.js CHANGED
@@ -11338,23 +11338,133 @@ async function withRetry2(fn, opts = {}) {
11338
11338
  }
11339
11339
  throw lastError;
11340
11340
  }
11341
- function toGoJson(ext) {
11342
- const obj = {
11343
- algorithm_id: ext.algorithm_id,
11344
- pqc_signature: base64(ext.pqc_signature)
11345
- };
11346
- if (ext.pqc_public_key !== void 0 && ext.pqc_public_key.length > 0) {
11347
- obj.pqc_public_key = base64(ext.pqc_public_key);
11341
+
11342
+ // src/codegen/qorechain/pqc/v1/hybrid.ts
11343
+ var hybrid_exports = {};
11344
+ __export(hybrid_exports, {
11345
+ PQCHybridSignature: () => PQCHybridSignature,
11346
+ protobufPackage: () => protobufPackage12
11347
+ });
11348
+ var protobufPackage12 = "qorechain.pqc.v1";
11349
+ function createBasePQCHybridSignature() {
11350
+ return { algorithmId: 0, pqcSignature: new Uint8Array(0), pqcPublicKey: new Uint8Array(0) };
11351
+ }
11352
+ var PQCHybridSignature = {
11353
+ encode(message, writer = new BinaryWriter()) {
11354
+ if (message.algorithmId !== 0) {
11355
+ writer.uint32(8).uint32(message.algorithmId);
11356
+ }
11357
+ if (message.pqcSignature.length !== 0) {
11358
+ writer.uint32(18).bytes(message.pqcSignature);
11359
+ }
11360
+ if (message.pqcPublicKey.length !== 0) {
11361
+ writer.uint32(26).bytes(message.pqcPublicKey);
11362
+ }
11363
+ return writer;
11364
+ },
11365
+ decode(input, length) {
11366
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
11367
+ const end = length === void 0 ? reader.len : reader.pos + length;
11368
+ const message = createBasePQCHybridSignature();
11369
+ while (reader.pos < end) {
11370
+ const tag = reader.uint32();
11371
+ switch (tag >>> 3) {
11372
+ case 1: {
11373
+ if (tag !== 8) {
11374
+ break;
11375
+ }
11376
+ message.algorithmId = reader.uint32();
11377
+ continue;
11378
+ }
11379
+ case 2: {
11380
+ if (tag !== 18) {
11381
+ break;
11382
+ }
11383
+ message.pqcSignature = reader.bytes();
11384
+ continue;
11385
+ }
11386
+ case 3: {
11387
+ if (tag !== 26) {
11388
+ break;
11389
+ }
11390
+ message.pqcPublicKey = reader.bytes();
11391
+ continue;
11392
+ }
11393
+ }
11394
+ if ((tag & 7) === 4 || tag === 0) {
11395
+ break;
11396
+ }
11397
+ reader.skip(tag & 7);
11398
+ }
11399
+ return message;
11400
+ },
11401
+ fromJSON(object) {
11402
+ return {
11403
+ algorithmId: isSet13(object.algorithmId) ? globalThis.Number(object.algorithmId) : isSet13(object.algorithm_id) ? globalThis.Number(object.algorithm_id) : 0,
11404
+ pqcSignature: isSet13(object.pqcSignature) ? bytesFromBase648(object.pqcSignature) : isSet13(object.pqc_signature) ? bytesFromBase648(object.pqc_signature) : new Uint8Array(0),
11405
+ pqcPublicKey: isSet13(object.pqcPublicKey) ? bytesFromBase648(object.pqcPublicKey) : isSet13(object.pqc_public_key) ? bytesFromBase648(object.pqc_public_key) : new Uint8Array(0)
11406
+ };
11407
+ },
11408
+ toJSON(message) {
11409
+ const obj = {};
11410
+ if (message.algorithmId !== 0) {
11411
+ obj.algorithmId = Math.round(message.algorithmId);
11412
+ }
11413
+ if (message.pqcSignature.length !== 0) {
11414
+ obj.pqcSignature = base64FromBytes8(message.pqcSignature);
11415
+ }
11416
+ if (message.pqcPublicKey.length !== 0) {
11417
+ obj.pqcPublicKey = base64FromBytes8(message.pqcPublicKey);
11418
+ }
11419
+ return obj;
11420
+ },
11421
+ create(base) {
11422
+ return PQCHybridSignature.fromPartial(base ?? {});
11423
+ },
11424
+ fromPartial(object) {
11425
+ const message = createBasePQCHybridSignature();
11426
+ message.algorithmId = object.algorithmId ?? 0;
11427
+ message.pqcSignature = object.pqcSignature ?? new Uint8Array(0);
11428
+ message.pqcPublicKey = object.pqcPublicKey ?? new Uint8Array(0);
11429
+ return message;
11430
+ }
11431
+ };
11432
+ function bytesFromBase648(b64) {
11433
+ if (globalThis.Buffer) {
11434
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
11435
+ } else {
11436
+ const bin = globalThis.atob(b64);
11437
+ const arr = new Uint8Array(bin.length);
11438
+ for (let i = 0; i < bin.length; ++i) {
11439
+ arr[i] = bin.charCodeAt(i);
11440
+ }
11441
+ return arr;
11348
11442
  }
11349
- return JSON.stringify(obj);
11350
11443
  }
11351
- function base64(bytes) {
11352
- let binary = "";
11353
- for (const b of bytes) binary += String.fromCharCode(b);
11354
- return btoa(binary);
11444
+ function base64FromBytes8(arr) {
11445
+ if (globalThis.Buffer) {
11446
+ return globalThis.Buffer.from(arr).toString("base64");
11447
+ } else {
11448
+ const bin = [];
11449
+ arr.forEach((byte) => {
11450
+ bin.push(globalThis.String.fromCharCode(byte));
11451
+ });
11452
+ return globalThis.btoa(bin.join(""));
11453
+ }
11454
+ }
11455
+ function isSet13(value) {
11456
+ return value !== null && value !== void 0;
11355
11457
  }
11458
+
11459
+ // src/tx/hybrid.ts
11356
11460
  function encodeHybridExtension(ext) {
11357
- const value = new TextEncoder().encode(toGoJson(ext));
11461
+ const value = PQCHybridSignature.encode(
11462
+ PQCHybridSignature.fromPartial({
11463
+ algorithmId: ext.algorithm_id,
11464
+ pqcSignature: ext.pqc_signature,
11465
+ pqcPublicKey: ext.pqc_public_key ?? new Uint8Array(0)
11466
+ })
11467
+ ).finish();
11358
11468
  return Any.fromPartial({ typeUrl: HYBRID_SIG_TYPE_URL, value });
11359
11469
  }
11360
11470
  function attachHybridExtension(body, ext, opts = {}) {
@@ -12120,123 +12230,6 @@ __export(codegen_exports, {
12120
12230
  svmQuery: () => query_exports13
12121
12231
  });
12122
12232
 
12123
- // src/codegen/qorechain/pqc/v1/hybrid.ts
12124
- var hybrid_exports = {};
12125
- __export(hybrid_exports, {
12126
- PQCHybridSignature: () => PQCHybridSignature,
12127
- protobufPackage: () => protobufPackage12
12128
- });
12129
- var protobufPackage12 = "qorechain.pqc.v1";
12130
- function createBasePQCHybridSignature() {
12131
- return { algorithmId: 0, pqcSignature: new Uint8Array(0), pqcPublicKey: new Uint8Array(0) };
12132
- }
12133
- var PQCHybridSignature = {
12134
- encode(message, writer = new BinaryWriter()) {
12135
- if (message.algorithmId !== 0) {
12136
- writer.uint32(8).uint32(message.algorithmId);
12137
- }
12138
- if (message.pqcSignature.length !== 0) {
12139
- writer.uint32(18).bytes(message.pqcSignature);
12140
- }
12141
- if (message.pqcPublicKey.length !== 0) {
12142
- writer.uint32(26).bytes(message.pqcPublicKey);
12143
- }
12144
- return writer;
12145
- },
12146
- decode(input, length) {
12147
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12148
- const end = length === void 0 ? reader.len : reader.pos + length;
12149
- const message = createBasePQCHybridSignature();
12150
- while (reader.pos < end) {
12151
- const tag = reader.uint32();
12152
- switch (tag >>> 3) {
12153
- case 1: {
12154
- if (tag !== 8) {
12155
- break;
12156
- }
12157
- message.algorithmId = reader.uint32();
12158
- continue;
12159
- }
12160
- case 2: {
12161
- if (tag !== 18) {
12162
- break;
12163
- }
12164
- message.pqcSignature = reader.bytes();
12165
- continue;
12166
- }
12167
- case 3: {
12168
- if (tag !== 26) {
12169
- break;
12170
- }
12171
- message.pqcPublicKey = reader.bytes();
12172
- continue;
12173
- }
12174
- }
12175
- if ((tag & 7) === 4 || tag === 0) {
12176
- break;
12177
- }
12178
- reader.skip(tag & 7);
12179
- }
12180
- return message;
12181
- },
12182
- fromJSON(object) {
12183
- return {
12184
- algorithmId: isSet13(object.algorithmId) ? globalThis.Number(object.algorithmId) : isSet13(object.algorithm_id) ? globalThis.Number(object.algorithm_id) : 0,
12185
- pqcSignature: isSet13(object.pqcSignature) ? bytesFromBase648(object.pqcSignature) : isSet13(object.pqc_signature) ? bytesFromBase648(object.pqc_signature) : new Uint8Array(0),
12186
- pqcPublicKey: isSet13(object.pqcPublicKey) ? bytesFromBase648(object.pqcPublicKey) : isSet13(object.pqc_public_key) ? bytesFromBase648(object.pqc_public_key) : new Uint8Array(0)
12187
- };
12188
- },
12189
- toJSON(message) {
12190
- const obj = {};
12191
- if (message.algorithmId !== 0) {
12192
- obj.algorithmId = Math.round(message.algorithmId);
12193
- }
12194
- if (message.pqcSignature.length !== 0) {
12195
- obj.pqcSignature = base64FromBytes8(message.pqcSignature);
12196
- }
12197
- if (message.pqcPublicKey.length !== 0) {
12198
- obj.pqcPublicKey = base64FromBytes8(message.pqcPublicKey);
12199
- }
12200
- return obj;
12201
- },
12202
- create(base) {
12203
- return PQCHybridSignature.fromPartial(base ?? {});
12204
- },
12205
- fromPartial(object) {
12206
- const message = createBasePQCHybridSignature();
12207
- message.algorithmId = object.algorithmId ?? 0;
12208
- message.pqcSignature = object.pqcSignature ?? new Uint8Array(0);
12209
- message.pqcPublicKey = object.pqcPublicKey ?? new Uint8Array(0);
12210
- return message;
12211
- }
12212
- };
12213
- function bytesFromBase648(b64) {
12214
- if (globalThis.Buffer) {
12215
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
12216
- } else {
12217
- const bin = globalThis.atob(b64);
12218
- const arr = new Uint8Array(bin.length);
12219
- for (let i = 0; i < bin.length; ++i) {
12220
- arr[i] = bin.charCodeAt(i);
12221
- }
12222
- return arr;
12223
- }
12224
- }
12225
- function base64FromBytes8(arr) {
12226
- if (globalThis.Buffer) {
12227
- return globalThis.Buffer.from(arr).toString("base64");
12228
- } else {
12229
- const bin = [];
12230
- arr.forEach((byte) => {
12231
- bin.push(globalThis.String.fromCharCode(byte));
12232
- });
12233
- return globalThis.btoa(bin.join(""));
12234
- }
12235
- }
12236
- function isSet13(value) {
12237
- return value !== null && value !== void 0;
12238
- }
12239
-
12240
12233
  // src/codegen/qorechain/abstractaccount/v1/query.ts
12241
12234
  var query_exports = {};
12242
12235
  __export(query_exports, {
@@ -24828,7 +24821,7 @@ async function migrateToHybrid(tx, opts) {
24828
24821
  }
24829
24822
 
24830
24823
  // src/index.ts
24831
- var VERSION = "0.6.0";
24824
+ var VERSION = "0.6.1";
24832
24825
 
24833
24826
  export { AlgorithmDilithium5, AlgorithmMLKEM1024, AlgorithmUnspecified, DEFAULT_GAS_MULTIPLIER, DEFAULT_GAS_PRICE, ETHSECP256K1_PUBKEY_TYPE, EthNativeSigner, GasPrice, HYBRID_SIG_TYPE_URL, HybridSigner, JsonRpcClient, JsonRpcError, ML_DSA_87_PUBLIC_KEY_LENGTH, ML_DSA_87_SECRET_KEY_LENGTH, ML_DSA_87_SEED_LENGTH, ML_DSA_87_SIGNATURE_LENGTH, MSG_SEND_TYPE_URL, NETWORKS, PHANTOM_DERIVATION_DOMAIN, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, PqcSigner, QorClient, QoreHttpError, QoreTxError, RestClient, STATIC_FALLBACK, TxClient, VERSION, VM_TYPES, abstractaccount, accountAuthInfo, addressesFrom20, algorithmName, amm, attachHybridExtension, authz, bank, bech32ToHex, bridge, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmToQor, execute, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, ibc, instantiate, instantiate2, isChecksumAddress, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, codegen_exports as qorechainTypes, queryContractSmart, rdk, requestFaucet, ripemd160, ripemd160Hex, rlconsensus, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry2 as withRetry };
24834
24827
  //# sourceMappingURL=index.js.map