@qorechain/sdk 0.8.0 → 0.8.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
@@ -2542,13 +2542,18 @@ declare function attachHybridExtension(body: TxBody, ext: PQCHybridSignature$1,
2542
2542
  * ──────────────────────────────────────────────────────────────────────────
2543
2543
  * Chain release v3.1.98 introduced the v2 forms, which bind a domain tag and
2544
2544
  * the chain id. Networks that existed before it (`qorechain-vladi`,
2545
- * `qorechain-diana`) verify v1 until the `v3.1.98` upgrade plan is applied on
2546
- * that network, and v2 from then on. Any other chain verifies v2 from its first
2545
+ * `qorechain-diana`) verify v1 until a v2 upgrade plan is applied on that
2546
+ * network, and v2 from then on. Any other chain verifies v2 from its first
2547
2547
  * block. The testnet and mainnet switch at different heights, so a client must
2548
2548
  * ask the target network rather than hardcode either form:
2549
2549
  *
2550
- * GET {rest}/cosmos/upgrade/v1beta1/applied_plan/v3.1.98 -> {"height":"<n>"}
2551
- * v2 iff n > 0, or the chain is not one of the legacy networks.
2550
+ * GET {rest}/cosmos/upgrade/v1beta1/applied_plan/<name> -> {"height":"<n>"}
2551
+ * for each name in SIGN_BYTES_V2_UPGRADES ("v3.2.0", then "v3.1.98")
2552
+ * v2 iff any n > 0, or the chain is not one of the legacy networks.
2553
+ *
2554
+ * Both names must be asked: the testnet switched under "v3.1.98" and keeps that
2555
+ * record, mainnet switches under "v3.2.0". Asking only one answers v1 on the
2556
+ * other network, and the chain then refuses every hybrid tx with `pqc` code 21.
2552
2557
  *
2553
2558
  * The height is an int64 and crosses the REST gateway as a STRING; a network
2554
2559
  * that has not upgraded answers `{"height":"0"}` (or `{}` on older nodes), so
@@ -2563,8 +2568,22 @@ declare function attachHybridExtension(body: TxBody, ext: PQCHybridSignature$1,
2563
2568
  type SignBytesVersion = "v1" | "v2";
2564
2569
  /** A form, or `"auto"` to ask the target network. */
2565
2570
  type SignBytesVersionOption = SignBytesVersion | "auto";
2566
- /** The upgrade plan whose application switches a legacy network to v2. */
2567
- declare const SIGN_BYTES_V2_UPGRADE = "v3.1.98";
2571
+ /**
2572
+ * The upgrade plan whose application switches a legacy network to v2 — the
2573
+ * name used from the v3.2.0 release onward. See {@link SIGN_BYTES_V2_UPGRADES}:
2574
+ * a client must accept either name, because the testnet took the switch under
2575
+ * the earlier one and keeps that record.
2576
+ */
2577
+ declare const SIGN_BYTES_V2_UPGRADE = "v3.2.0";
2578
+ /**
2579
+ * Every upgrade name that has switched a network to the v2 sign-bytes, most
2580
+ * recent first. The testnet applied `"v3.1.98"` and its record stays in state
2581
+ * forever; mainnet applies `"v3.2.0"`. A network is on v2 if ANY of these is
2582
+ * applied, so a client asks for each in turn and stops at the first positive
2583
+ * height — querying only one name answers v1 on the other network and every
2584
+ * hybrid transaction is then refused with `pqc` code 21.
2585
+ */
2586
+ declare const SIGN_BYTES_V2_UPGRADES: readonly string[];
2568
2587
  /** Networks that ran before v2 existed and switch only at {@link SIGN_BYTES_V2_UPGRADE}. */
2569
2588
  declare const LEGACY_SIGN_BYTES_CHAINS: readonly string[];
2570
2589
  /** Domain tag of the v2 hybrid PQC sign-bytes. */
@@ -2642,10 +2661,17 @@ declare function isLegacySignBytesChain(chainId: string): boolean;
2642
2661
  */
2643
2662
  declare function signBytesVersionFor(chainId: string, v2AppliedHeight: number | bigint): SignBytesVersion;
2644
2663
  /**
2645
- * Ask a node at which height the v3.1.98 plan was applied (0 when not).
2664
+ * Ask a node at which height an upgrade plan was applied (0 when it has not
2665
+ * been). Defaults to {@link SIGN_BYTES_V2_UPGRADE}; pass a name from
2666
+ * {@link SIGN_BYTES_V2_UPGRADES} to ask for an earlier one.
2646
2667
  * @throws on a transport or parse failure — the caller must not guess.
2647
2668
  */
2648
- declare function fetchSignBytesV2AppliedHeight(rest: string, fetchImpl?: FetchLike): Promise<bigint>;
2669
+ declare function fetchSignBytesV2AppliedHeight(rest: string, fetchImpl?: FetchLike, upgradeName?: string): Promise<bigint>;
2670
+ /**
2671
+ * The greatest applied height across {@link SIGN_BYTES_V2_UPGRADES}, stopping
2672
+ * at the first positive one. 0 means no v2 upgrade has been applied.
2673
+ */
2674
+ declare function fetchSignBytesV2AppliedHeightAny(rest: string, fetchImpl?: FetchLike): Promise<bigint>;
2649
2675
  /** Options for {@link resolveSignBytesVersion}. */
2650
2676
  interface ResolveSignBytesVersionOptions {
2651
2677
  chainId: string;
@@ -10898,4 +10924,4 @@ declare function migrateToHybrid(tx: TxClient, opts: MigrateToHybridOptions): Pr
10898
10924
  /** SDK version. */
10899
10925
  declare const VERSION = "0.8.0";
10900
10926
 
10901
- export { type AbstractAccountConfigView, type AbstractAccountQueryClient, type AbstractAccountView, type Account, type AccountSequence, AlgorithmDilithium5, type AlgorithmID, AlgorithmMLKEM1024, AlgorithmUnspecified, type AllBalancesResponse, type AmmQueryClient, type AnchorStateOptions, type AttachHybridOptions, type AuthenticatorWallet, type AutoFeeOptions, BRIDGE_ATTESTATION_V2_DOMAIN, type BalanceResponse, type BankSendOptions, type Bech32Config, type Bech32Prefixes, type BridgeAttestationSignBytesInput, type BridgeQueryClient, type BroadcastMode, type BroadcastResult, type BuildHybridTxOptions, type BuildMetaMaskExecuteCosmosOptions, type BuildMetaMaskExecuteEvmOptions, type BuildPhantomExecuteCosmosOptions, type BuildPhantomExecuteEvmOptions, type BuiltHybridTx, CANONICAL_DERIVATION, type CallOptions, type ChallengeBatchOptions, type ClientFees, type CoinInfo, type ConnectPhantomUnifiedOptions, type ConnectTxOptions, type ContractMsg, type CosmWasmPayload, type CosmWasmReadClient, type CosmWasmSigningClient, type CosmosAuthSignBytesInput, 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 Eip1193Provider, type EnsurePqcRegisteredOptions, type EnsurePqcRegisteredResult, type EstimateFeeOptions, type EthBroadcaster, EthNativeSigner, type EthNativeSignerOptions, type EthSignParams, type EthSigningKey, type EthTxParams, type EventFilters, type EventStream, type EvmAuthSignBytesInput, type EvmPayload, type ExecuteCosmosMsgInput, type ExecuteEvmMsgInput, type ExecuteWithdrawalOptions, type ExplorerConfig, type FaucetConfig, type FeeInput, type FeeUrgency, type FetchLike, GasPrice, type GetBlockResponse, type GetCosmosWalletOptions, type GetJsonOptions, type GetTxFn, type GetTxResponse, HYBRID_SIGN_BYTES_REJECTION_LOG, HYBRID_SIGN_BYTES_V2_DOMAIN, 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, LEGACY_DERIVATION, LEGACY_SIGN_BYTES_CHAINS, type LicenseQueryClient, type LightNodeQueryClient, MIGRATION_SIGN_BYTES_V2_DOMAIN, 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 MigrationSignBytesInput, type MultilayerClient, type MultilayerQueryClient, type MultilayerWriteOptions, NETWORKS, type NetworkConfig, type NetworkEndpoints, type NetworkName, type NewBlockEventLike, type PQCHybridSignature$1 as PQCHybridSignature, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, type PageResponse, type PaginatedOptions, type Pagination, type ParsedAccountAuth, type PayloadInput, type PendingCrossVmMessagesResponse, type PermissionSchemaResponse, 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 RegisterEthAuthenticatorMsgInput, type RegisterPaychainOptions, type RegisterSidechainOptions, type ReputationQueryClient, type RequestFaucetOptions, type ResolveChallengeOptions, type ResolveSignBytesVersionOptions, RestClient, type RestClientOptions, type RetryOptions, type RevokeAuthenticatorMsgInput, type RlConsensusQueryClient, type RollupClient, type RollupLifecycleOptions, type RollupWriteOptions, type RotatePqcKeyMsgFromMnemonicOptions, type RotatePqcKeyMsgFromMnemonicResult, type RotatePqcKeyMsgInput, type RouteTransactionOptions, SIGN_BYTES_V2_UPGRADE, STATIC_FALLBACK, type SearchTxsOptions, type SearchTxsResponse, type Secp256k1Account, type SignAndBroadcastHybridOptions, type SignAndBroadcastOptions, type SignBytesVersion, type SignBytesVersionOption, 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, be64, bech32ToHex, bridge, bridgeAttestationSignBytes, bridgeAttestationSignBytesV1, bridgeAttestationSignBytesV2, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildMetaMaskExecuteCosmos, buildMetaMaskExecuteEvm, buildPhantomExecuteCosmos, buildPhantomExecuteEvm, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, clearSignBytesCache, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, cosmosAuthSignBytes, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, derivePqcLegacy, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmAuthSignBytes, evmToQor, execute, executeCosmosMsg, executeEvmMsg, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, fetchSignBytesV2AppliedHeight, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, hybridSignBytes, hybridSignBytesV1, hybridSignBytesV2, ibc, instantiate, instantiate2, isChecksumAddress, isHybridSignBytesRejection, isLegacySignBytesChain, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, lengthPrefixed, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, migrationSignBytes, migrationSignBytesV1, migrationSignBytesV2, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, index as qorechainTypes, queryContractSmart, rdk, registerEthAuthenticatorMsg, requestFaucet, resolveSignBytesVersion, revokeAuthenticatorMsg, ripemd160, ripemd160Hex, rlconsensus, rotatePqcKeyMsg, rotatePqcKeyMsgFromMnemonic, rotationSignBytes, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signBytesVersionFor, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry };
10927
+ export { type AbstractAccountConfigView, type AbstractAccountQueryClient, type AbstractAccountView, type Account, type AccountSequence, AlgorithmDilithium5, type AlgorithmID, AlgorithmMLKEM1024, AlgorithmUnspecified, type AllBalancesResponse, type AmmQueryClient, type AnchorStateOptions, type AttachHybridOptions, type AuthenticatorWallet, type AutoFeeOptions, BRIDGE_ATTESTATION_V2_DOMAIN, type BalanceResponse, type BankSendOptions, type Bech32Config, type Bech32Prefixes, type BridgeAttestationSignBytesInput, type BridgeQueryClient, type BroadcastMode, type BroadcastResult, type BuildHybridTxOptions, type BuildMetaMaskExecuteCosmosOptions, type BuildMetaMaskExecuteEvmOptions, type BuildPhantomExecuteCosmosOptions, type BuildPhantomExecuteEvmOptions, type BuiltHybridTx, CANONICAL_DERIVATION, type CallOptions, type ChallengeBatchOptions, type ClientFees, type CoinInfo, type ConnectPhantomUnifiedOptions, type ConnectTxOptions, type ContractMsg, type CosmWasmPayload, type CosmWasmReadClient, type CosmWasmSigningClient, type CosmosAuthSignBytesInput, 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 Eip1193Provider, type EnsurePqcRegisteredOptions, type EnsurePqcRegisteredResult, type EstimateFeeOptions, type EthBroadcaster, EthNativeSigner, type EthNativeSignerOptions, type EthSignParams, type EthSigningKey, type EthTxParams, type EventFilters, type EventStream, type EvmAuthSignBytesInput, type EvmPayload, type ExecuteCosmosMsgInput, type ExecuteEvmMsgInput, type ExecuteWithdrawalOptions, type ExplorerConfig, type FaucetConfig, type FeeInput, type FeeUrgency, type FetchLike, GasPrice, type GetBlockResponse, type GetCosmosWalletOptions, type GetJsonOptions, type GetTxFn, type GetTxResponse, HYBRID_SIGN_BYTES_REJECTION_LOG, HYBRID_SIGN_BYTES_V2_DOMAIN, 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, LEGACY_DERIVATION, LEGACY_SIGN_BYTES_CHAINS, type LicenseQueryClient, type LightNodeQueryClient, MIGRATION_SIGN_BYTES_V2_DOMAIN, 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 MigrationSignBytesInput, type MultilayerClient, type MultilayerQueryClient, type MultilayerWriteOptions, NETWORKS, type NetworkConfig, type NetworkEndpoints, type NetworkName, type NewBlockEventLike, type PQCHybridSignature$1 as PQCHybridSignature, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, type PageResponse, type PaginatedOptions, type Pagination, type ParsedAccountAuth, type PayloadInput, type PendingCrossVmMessagesResponse, type PermissionSchemaResponse, 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 RegisterEthAuthenticatorMsgInput, type RegisterPaychainOptions, type RegisterSidechainOptions, type ReputationQueryClient, type RequestFaucetOptions, type ResolveChallengeOptions, type ResolveSignBytesVersionOptions, RestClient, type RestClientOptions, type RetryOptions, type RevokeAuthenticatorMsgInput, type RlConsensusQueryClient, type RollupClient, type RollupLifecycleOptions, type RollupWriteOptions, type RotatePqcKeyMsgFromMnemonicOptions, type RotatePqcKeyMsgFromMnemonicResult, type RotatePqcKeyMsgInput, type RouteTransactionOptions, SIGN_BYTES_V2_UPGRADE, SIGN_BYTES_V2_UPGRADES, STATIC_FALLBACK, type SearchTxsOptions, type SearchTxsResponse, type Secp256k1Account, type SignAndBroadcastHybridOptions, type SignAndBroadcastOptions, type SignBytesVersion, type SignBytesVersionOption, 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, be64, bech32ToHex, bridge, bridgeAttestationSignBytes, bridgeAttestationSignBytesV1, bridgeAttestationSignBytesV2, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildMetaMaskExecuteCosmos, buildMetaMaskExecuteEvm, buildPhantomExecuteCosmos, buildPhantomExecuteEvm, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, clearSignBytesCache, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, cosmosAuthSignBytes, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, derivePqcLegacy, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmAuthSignBytes, evmToQor, execute, executeCosmosMsg, executeEvmMsg, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, fetchSignBytesV2AppliedHeight, fetchSignBytesV2AppliedHeightAny, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, hybridSignBytes, hybridSignBytesV1, hybridSignBytesV2, ibc, instantiate, instantiate2, isChecksumAddress, isHybridSignBytesRejection, isLegacySignBytesChain, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, lengthPrefixed, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, migrationSignBytes, migrationSignBytesV1, migrationSignBytesV2, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, index as qorechainTypes, queryContractSmart, rdk, registerEthAuthenticatorMsg, requestFaucet, resolveSignBytesVersion, revokeAuthenticatorMsg, ripemd160, ripemd160Hex, rlconsensus, rotatePqcKeyMsg, rotatePqcKeyMsgFromMnemonic, rotationSignBytes, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signBytesVersionFor, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry };
package/dist/index.d.ts CHANGED
@@ -2542,13 +2542,18 @@ declare function attachHybridExtension(body: TxBody, ext: PQCHybridSignature$1,
2542
2542
  * ──────────────────────────────────────────────────────────────────────────
2543
2543
  * Chain release v3.1.98 introduced the v2 forms, which bind a domain tag and
2544
2544
  * the chain id. Networks that existed before it (`qorechain-vladi`,
2545
- * `qorechain-diana`) verify v1 until the `v3.1.98` upgrade plan is applied on
2546
- * that network, and v2 from then on. Any other chain verifies v2 from its first
2545
+ * `qorechain-diana`) verify v1 until a v2 upgrade plan is applied on that
2546
+ * network, and v2 from then on. Any other chain verifies v2 from its first
2547
2547
  * block. The testnet and mainnet switch at different heights, so a client must
2548
2548
  * ask the target network rather than hardcode either form:
2549
2549
  *
2550
- * GET {rest}/cosmos/upgrade/v1beta1/applied_plan/v3.1.98 -> {"height":"<n>"}
2551
- * v2 iff n > 0, or the chain is not one of the legacy networks.
2550
+ * GET {rest}/cosmos/upgrade/v1beta1/applied_plan/<name> -> {"height":"<n>"}
2551
+ * for each name in SIGN_BYTES_V2_UPGRADES ("v3.2.0", then "v3.1.98")
2552
+ * v2 iff any n > 0, or the chain is not one of the legacy networks.
2553
+ *
2554
+ * Both names must be asked: the testnet switched under "v3.1.98" and keeps that
2555
+ * record, mainnet switches under "v3.2.0". Asking only one answers v1 on the
2556
+ * other network, and the chain then refuses every hybrid tx with `pqc` code 21.
2552
2557
  *
2553
2558
  * The height is an int64 and crosses the REST gateway as a STRING; a network
2554
2559
  * that has not upgraded answers `{"height":"0"}` (or `{}` on older nodes), so
@@ -2563,8 +2568,22 @@ declare function attachHybridExtension(body: TxBody, ext: PQCHybridSignature$1,
2563
2568
  type SignBytesVersion = "v1" | "v2";
2564
2569
  /** A form, or `"auto"` to ask the target network. */
2565
2570
  type SignBytesVersionOption = SignBytesVersion | "auto";
2566
- /** The upgrade plan whose application switches a legacy network to v2. */
2567
- declare const SIGN_BYTES_V2_UPGRADE = "v3.1.98";
2571
+ /**
2572
+ * The upgrade plan whose application switches a legacy network to v2 — the
2573
+ * name used from the v3.2.0 release onward. See {@link SIGN_BYTES_V2_UPGRADES}:
2574
+ * a client must accept either name, because the testnet took the switch under
2575
+ * the earlier one and keeps that record.
2576
+ */
2577
+ declare const SIGN_BYTES_V2_UPGRADE = "v3.2.0";
2578
+ /**
2579
+ * Every upgrade name that has switched a network to the v2 sign-bytes, most
2580
+ * recent first. The testnet applied `"v3.1.98"` and its record stays in state
2581
+ * forever; mainnet applies `"v3.2.0"`. A network is on v2 if ANY of these is
2582
+ * applied, so a client asks for each in turn and stops at the first positive
2583
+ * height — querying only one name answers v1 on the other network and every
2584
+ * hybrid transaction is then refused with `pqc` code 21.
2585
+ */
2586
+ declare const SIGN_BYTES_V2_UPGRADES: readonly string[];
2568
2587
  /** Networks that ran before v2 existed and switch only at {@link SIGN_BYTES_V2_UPGRADE}. */
2569
2588
  declare const LEGACY_SIGN_BYTES_CHAINS: readonly string[];
2570
2589
  /** Domain tag of the v2 hybrid PQC sign-bytes. */
@@ -2642,10 +2661,17 @@ declare function isLegacySignBytesChain(chainId: string): boolean;
2642
2661
  */
2643
2662
  declare function signBytesVersionFor(chainId: string, v2AppliedHeight: number | bigint): SignBytesVersion;
2644
2663
  /**
2645
- * Ask a node at which height the v3.1.98 plan was applied (0 when not).
2664
+ * Ask a node at which height an upgrade plan was applied (0 when it has not
2665
+ * been). Defaults to {@link SIGN_BYTES_V2_UPGRADE}; pass a name from
2666
+ * {@link SIGN_BYTES_V2_UPGRADES} to ask for an earlier one.
2646
2667
  * @throws on a transport or parse failure — the caller must not guess.
2647
2668
  */
2648
- declare function fetchSignBytesV2AppliedHeight(rest: string, fetchImpl?: FetchLike): Promise<bigint>;
2669
+ declare function fetchSignBytesV2AppliedHeight(rest: string, fetchImpl?: FetchLike, upgradeName?: string): Promise<bigint>;
2670
+ /**
2671
+ * The greatest applied height across {@link SIGN_BYTES_V2_UPGRADES}, stopping
2672
+ * at the first positive one. 0 means no v2 upgrade has been applied.
2673
+ */
2674
+ declare function fetchSignBytesV2AppliedHeightAny(rest: string, fetchImpl?: FetchLike): Promise<bigint>;
2649
2675
  /** Options for {@link resolveSignBytesVersion}. */
2650
2676
  interface ResolveSignBytesVersionOptions {
2651
2677
  chainId: string;
@@ -10898,4 +10924,4 @@ declare function migrateToHybrid(tx: TxClient, opts: MigrateToHybridOptions): Pr
10898
10924
  /** SDK version. */
10899
10925
  declare const VERSION = "0.8.0";
10900
10926
 
10901
- export { type AbstractAccountConfigView, type AbstractAccountQueryClient, type AbstractAccountView, type Account, type AccountSequence, AlgorithmDilithium5, type AlgorithmID, AlgorithmMLKEM1024, AlgorithmUnspecified, type AllBalancesResponse, type AmmQueryClient, type AnchorStateOptions, type AttachHybridOptions, type AuthenticatorWallet, type AutoFeeOptions, BRIDGE_ATTESTATION_V2_DOMAIN, type BalanceResponse, type BankSendOptions, type Bech32Config, type Bech32Prefixes, type BridgeAttestationSignBytesInput, type BridgeQueryClient, type BroadcastMode, type BroadcastResult, type BuildHybridTxOptions, type BuildMetaMaskExecuteCosmosOptions, type BuildMetaMaskExecuteEvmOptions, type BuildPhantomExecuteCosmosOptions, type BuildPhantomExecuteEvmOptions, type BuiltHybridTx, CANONICAL_DERIVATION, type CallOptions, type ChallengeBatchOptions, type ClientFees, type CoinInfo, type ConnectPhantomUnifiedOptions, type ConnectTxOptions, type ContractMsg, type CosmWasmPayload, type CosmWasmReadClient, type CosmWasmSigningClient, type CosmosAuthSignBytesInput, 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 Eip1193Provider, type EnsurePqcRegisteredOptions, type EnsurePqcRegisteredResult, type EstimateFeeOptions, type EthBroadcaster, EthNativeSigner, type EthNativeSignerOptions, type EthSignParams, type EthSigningKey, type EthTxParams, type EventFilters, type EventStream, type EvmAuthSignBytesInput, type EvmPayload, type ExecuteCosmosMsgInput, type ExecuteEvmMsgInput, type ExecuteWithdrawalOptions, type ExplorerConfig, type FaucetConfig, type FeeInput, type FeeUrgency, type FetchLike, GasPrice, type GetBlockResponse, type GetCosmosWalletOptions, type GetJsonOptions, type GetTxFn, type GetTxResponse, HYBRID_SIGN_BYTES_REJECTION_LOG, HYBRID_SIGN_BYTES_V2_DOMAIN, 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, LEGACY_DERIVATION, LEGACY_SIGN_BYTES_CHAINS, type LicenseQueryClient, type LightNodeQueryClient, MIGRATION_SIGN_BYTES_V2_DOMAIN, 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 MigrationSignBytesInput, type MultilayerClient, type MultilayerQueryClient, type MultilayerWriteOptions, NETWORKS, type NetworkConfig, type NetworkEndpoints, type NetworkName, type NewBlockEventLike, type PQCHybridSignature$1 as PQCHybridSignature, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, type PageResponse, type PaginatedOptions, type Pagination, type ParsedAccountAuth, type PayloadInput, type PendingCrossVmMessagesResponse, type PermissionSchemaResponse, 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 RegisterEthAuthenticatorMsgInput, type RegisterPaychainOptions, type RegisterSidechainOptions, type ReputationQueryClient, type RequestFaucetOptions, type ResolveChallengeOptions, type ResolveSignBytesVersionOptions, RestClient, type RestClientOptions, type RetryOptions, type RevokeAuthenticatorMsgInput, type RlConsensusQueryClient, type RollupClient, type RollupLifecycleOptions, type RollupWriteOptions, type RotatePqcKeyMsgFromMnemonicOptions, type RotatePqcKeyMsgFromMnemonicResult, type RotatePqcKeyMsgInput, type RouteTransactionOptions, SIGN_BYTES_V2_UPGRADE, STATIC_FALLBACK, type SearchTxsOptions, type SearchTxsResponse, type Secp256k1Account, type SignAndBroadcastHybridOptions, type SignAndBroadcastOptions, type SignBytesVersion, type SignBytesVersionOption, 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, be64, bech32ToHex, bridge, bridgeAttestationSignBytes, bridgeAttestationSignBytesV1, bridgeAttestationSignBytesV2, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildMetaMaskExecuteCosmos, buildMetaMaskExecuteEvm, buildPhantomExecuteCosmos, buildPhantomExecuteEvm, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, clearSignBytesCache, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, cosmosAuthSignBytes, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, derivePqcLegacy, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmAuthSignBytes, evmToQor, execute, executeCosmosMsg, executeEvmMsg, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, fetchSignBytesV2AppliedHeight, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, hybridSignBytes, hybridSignBytesV1, hybridSignBytesV2, ibc, instantiate, instantiate2, isChecksumAddress, isHybridSignBytesRejection, isLegacySignBytesChain, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, lengthPrefixed, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, migrationSignBytes, migrationSignBytesV1, migrationSignBytesV2, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, index as qorechainTypes, queryContractSmart, rdk, registerEthAuthenticatorMsg, requestFaucet, resolveSignBytesVersion, revokeAuthenticatorMsg, ripemd160, ripemd160Hex, rlconsensus, rotatePqcKeyMsg, rotatePqcKeyMsgFromMnemonic, rotationSignBytes, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signBytesVersionFor, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry };
10927
+ export { type AbstractAccountConfigView, type AbstractAccountQueryClient, type AbstractAccountView, type Account, type AccountSequence, AlgorithmDilithium5, type AlgorithmID, AlgorithmMLKEM1024, AlgorithmUnspecified, type AllBalancesResponse, type AmmQueryClient, type AnchorStateOptions, type AttachHybridOptions, type AuthenticatorWallet, type AutoFeeOptions, BRIDGE_ATTESTATION_V2_DOMAIN, type BalanceResponse, type BankSendOptions, type Bech32Config, type Bech32Prefixes, type BridgeAttestationSignBytesInput, type BridgeQueryClient, type BroadcastMode, type BroadcastResult, type BuildHybridTxOptions, type BuildMetaMaskExecuteCosmosOptions, type BuildMetaMaskExecuteEvmOptions, type BuildPhantomExecuteCosmosOptions, type BuildPhantomExecuteEvmOptions, type BuiltHybridTx, CANONICAL_DERIVATION, type CallOptions, type ChallengeBatchOptions, type ClientFees, type CoinInfo, type ConnectPhantomUnifiedOptions, type ConnectTxOptions, type ContractMsg, type CosmWasmPayload, type CosmWasmReadClient, type CosmWasmSigningClient, type CosmosAuthSignBytesInput, 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 Eip1193Provider, type EnsurePqcRegisteredOptions, type EnsurePqcRegisteredResult, type EstimateFeeOptions, type EthBroadcaster, EthNativeSigner, type EthNativeSignerOptions, type EthSignParams, type EthSigningKey, type EthTxParams, type EventFilters, type EventStream, type EvmAuthSignBytesInput, type EvmPayload, type ExecuteCosmosMsgInput, type ExecuteEvmMsgInput, type ExecuteWithdrawalOptions, type ExplorerConfig, type FaucetConfig, type FeeInput, type FeeUrgency, type FetchLike, GasPrice, type GetBlockResponse, type GetCosmosWalletOptions, type GetJsonOptions, type GetTxFn, type GetTxResponse, HYBRID_SIGN_BYTES_REJECTION_LOG, HYBRID_SIGN_BYTES_V2_DOMAIN, 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, LEGACY_DERIVATION, LEGACY_SIGN_BYTES_CHAINS, type LicenseQueryClient, type LightNodeQueryClient, MIGRATION_SIGN_BYTES_V2_DOMAIN, 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 MigrationSignBytesInput, type MultilayerClient, type MultilayerQueryClient, type MultilayerWriteOptions, NETWORKS, type NetworkConfig, type NetworkEndpoints, type NetworkName, type NewBlockEventLike, type PQCHybridSignature$1 as PQCHybridSignature, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, type PageResponse, type PaginatedOptions, type Pagination, type ParsedAccountAuth, type PayloadInput, type PendingCrossVmMessagesResponse, type PermissionSchemaResponse, 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 RegisterEthAuthenticatorMsgInput, type RegisterPaychainOptions, type RegisterSidechainOptions, type ReputationQueryClient, type RequestFaucetOptions, type ResolveChallengeOptions, type ResolveSignBytesVersionOptions, RestClient, type RestClientOptions, type RetryOptions, type RevokeAuthenticatorMsgInput, type RlConsensusQueryClient, type RollupClient, type RollupLifecycleOptions, type RollupWriteOptions, type RotatePqcKeyMsgFromMnemonicOptions, type RotatePqcKeyMsgFromMnemonicResult, type RotatePqcKeyMsgInput, type RouteTransactionOptions, SIGN_BYTES_V2_UPGRADE, SIGN_BYTES_V2_UPGRADES, STATIC_FALLBACK, type SearchTxsOptions, type SearchTxsResponse, type Secp256k1Account, type SignAndBroadcastHybridOptions, type SignAndBroadcastOptions, type SignBytesVersion, type SignBytesVersionOption, 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, be64, bech32ToHex, bridge, bridgeAttestationSignBytes, bridgeAttestationSignBytesV1, bridgeAttestationSignBytesV2, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildMetaMaskExecuteCosmos, buildMetaMaskExecuteEvm, buildPhantomExecuteCosmos, buildPhantomExecuteEvm, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, clearSignBytesCache, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, cosmosAuthSignBytes, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, derivePqcLegacy, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmAuthSignBytes, evmToQor, execute, executeCosmosMsg, executeEvmMsg, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, fetchSignBytesV2AppliedHeight, fetchSignBytesV2AppliedHeightAny, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, hybridSignBytes, hybridSignBytesV1, hybridSignBytesV2, ibc, instantiate, instantiate2, isChecksumAddress, isHybridSignBytesRejection, isLegacySignBytesChain, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, lengthPrefixed, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, migrationSignBytes, migrationSignBytesV1, migrationSignBytesV2, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, index as qorechainTypes, queryContractSmart, rdk, registerEthAuthenticatorMsg, requestFaucet, resolveSignBytesVersion, revokeAuthenticatorMsg, ripemd160, ripemd160Hex, rlconsensus, rotatePqcKeyMsg, rotatePqcKeyMsgFromMnemonic, rotationSignBytes, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signBytesVersionFor, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry };
package/dist/index.js CHANGED
@@ -12703,7 +12703,8 @@ function attachHybridExtension(body, ext, opts = {}) {
12703
12703
  }
12704
12704
 
12705
12705
  // src/tx/signbytes.ts
12706
- var SIGN_BYTES_V2_UPGRADE = "v3.1.98";
12706
+ var SIGN_BYTES_V2_UPGRADE = "v3.2.0";
12707
+ var SIGN_BYTES_V2_UPGRADES = ["v3.2.0", "v3.1.98"];
12707
12708
  var LEGACY_SIGN_BYTES_CHAINS = [
12708
12709
  "qorechain-vladi",
12709
12710
  "qorechain-diana"
@@ -12823,14 +12824,21 @@ function parseAppliedHeight(body) {
12823
12824
  }
12824
12825
  return BigInt(h);
12825
12826
  }
12826
- async function fetchSignBytesV2AppliedHeight(rest, fetchImpl = globalThis.fetch) {
12827
- const url = `${rest.replace(/\/+$/, "")}/cosmos/upgrade/v1beta1/applied_plan/${SIGN_BYTES_V2_UPGRADE}`;
12827
+ async function fetchSignBytesV2AppliedHeight(rest, fetchImpl = globalThis.fetch, upgradeName = SIGN_BYTES_V2_UPGRADE) {
12828
+ const url = `${rest.replace(/\/+$/, "")}/cosmos/upgrade/v1beta1/applied_plan/${upgradeName}`;
12828
12829
  const res = await fetchImpl(url);
12829
12830
  if (!res.ok) {
12830
12831
  throw new Error(`applied_plan query failed: HTTP ${res.status} from ${url}`);
12831
12832
  }
12832
12833
  return parseAppliedHeight(await res.json());
12833
12834
  }
12835
+ async function fetchSignBytesV2AppliedHeightAny(rest, fetchImpl = globalThis.fetch) {
12836
+ for (const name of SIGN_BYTES_V2_UPGRADES) {
12837
+ const height = await fetchSignBytesV2AppliedHeight(rest, fetchImpl, name);
12838
+ if (height > 0n) return height;
12839
+ }
12840
+ return 0n;
12841
+ }
12834
12842
  var cache = /* @__PURE__ */ new Map();
12835
12843
  function clearSignBytesCache() {
12836
12844
  cache.clear();
@@ -12844,7 +12852,7 @@ async function resolveSignBytesVersion(opts) {
12844
12852
  if (!isLegacySignBytesChain(opts.chainId)) return "v2";
12845
12853
  if (!opts.rest) {
12846
12854
  throw new Error(
12847
- `cannot choose the hybrid sign-bytes form for ${opts.chainId} without its REST endpoint: pass rest, or signBytesVersion "v1" (before the ${SIGN_BYTES_V2_UPGRADE} upgrade) or "v2" (after)`
12855
+ `cannot choose the hybrid sign-bytes form for ${opts.chainId} without its REST endpoint: pass rest, or signBytesVersion "v1" (before the ${SIGN_BYTES_V2_UPGRADES.join(" / ")} upgrade) or "v2" (after)`
12848
12856
  );
12849
12857
  }
12850
12858
  const key = `${opts.rest}\0${opts.chainId}`;
@@ -12853,10 +12861,10 @@ async function resolveSignBytesVersion(opts) {
12853
12861
  if (!opts.forceRefresh && hit && Date.now() - hit.at < ttl) return hit.version;
12854
12862
  let height;
12855
12863
  try {
12856
- height = await fetchSignBytesV2AppliedHeight(opts.rest, opts.fetch);
12864
+ height = await fetchSignBytesV2AppliedHeightAny(opts.rest, opts.fetch);
12857
12865
  } catch (e) {
12858
12866
  throw new Error(
12859
- `cannot ask ${opts.rest} whether ${SIGN_BYTES_V2_UPGRADE} is applied (${e.message}); pass signBytesVersion "v1" or "v2"`
12867
+ `cannot ask ${opts.rest} whether any of ${SIGN_BYTES_V2_UPGRADES.join(", ")} is applied (${e.message}); pass signBytesVersion "v1" or "v2"`
12860
12868
  );
12861
12869
  }
12862
12870
  const version = signBytesVersionFor(opts.chainId, height);
@@ -27037,6 +27045,6 @@ async function migrateToHybrid(tx, opts) {
27037
27045
  // src/index.ts
27038
27046
  var VERSION = "0.8.0";
27039
27047
 
27040
- export { AlgorithmDilithium5, AlgorithmMLKEM1024, AlgorithmUnspecified, BRIDGE_ATTESTATION_V2_DOMAIN, CANONICAL_DERIVATION, DEFAULT_GAS_MULTIPLIER, DEFAULT_GAS_PRICE, ETHSECP256K1_PUBKEY_TYPE, EthNativeSigner, GasPrice, HYBRID_SIGN_BYTES_REJECTION_LOG, HYBRID_SIGN_BYTES_V2_DOMAIN, HYBRID_SIG_TYPE_URL, HybridSigner, JsonRpcClient, JsonRpcError, LEGACY_DERIVATION, LEGACY_SIGN_BYTES_CHAINS, MIGRATION_SIGN_BYTES_V2_DOMAIN, 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, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, PqcSigner, QorClient, QoreHttpError, QoreTxError, RestClient, SIGN_BYTES_V2_UPGRADE, STATIC_FALLBACK, TxClient, VERSION, VM_TYPES, abstractaccount, accountAuthInfo, addressesFrom20, algorithmName, amm, attachHybridExtension, authz, bank, be64, bech32ToHex, bridge, bridgeAttestationSignBytes, bridgeAttestationSignBytesV1, bridgeAttestationSignBytesV2, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildMetaMaskExecuteCosmos, buildMetaMaskExecuteEvm, buildPhantomExecuteCosmos, buildPhantomExecuteEvm, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, clearSignBytesCache, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, cosmosAuthSignBytes, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, derivePqcLegacy, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmAuthSignBytes, evmToQor, execute, executeCosmosMsg, executeEvmMsg, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, fetchSignBytesV2AppliedHeight, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, hybridSignBytes, hybridSignBytesV1, hybridSignBytesV2, ibc, instantiate, instantiate2, isChecksumAddress, isHybridSignBytesRejection, isLegacySignBytesChain, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, lengthPrefixed, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, migrationSignBytes, migrationSignBytesV1, migrationSignBytesV2, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, codegen_exports as qorechainTypes, queryContractSmart, rdk, registerEthAuthenticatorMsg, requestFaucet, resolveSignBytesVersion, revokeAuthenticatorMsg, ripemd160, ripemd160Hex, rlconsensus, rotatePqcKeyMsg, rotatePqcKeyMsgFromMnemonic, rotationSignBytes, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signBytesVersionFor, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry2 as withRetry };
27048
+ export { AlgorithmDilithium5, AlgorithmMLKEM1024, AlgorithmUnspecified, BRIDGE_ATTESTATION_V2_DOMAIN, CANONICAL_DERIVATION, DEFAULT_GAS_MULTIPLIER, DEFAULT_GAS_PRICE, ETHSECP256K1_PUBKEY_TYPE, EthNativeSigner, GasPrice, HYBRID_SIGN_BYTES_REJECTION_LOG, HYBRID_SIGN_BYTES_V2_DOMAIN, HYBRID_SIG_TYPE_URL, HybridSigner, JsonRpcClient, JsonRpcError, LEGACY_DERIVATION, LEGACY_SIGN_BYTES_CHAINS, MIGRATION_SIGN_BYTES_V2_DOMAIN, 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, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, PqcSigner, QorClient, QoreHttpError, QoreTxError, RestClient, SIGN_BYTES_V2_UPGRADE, SIGN_BYTES_V2_UPGRADES, STATIC_FALLBACK, TxClient, VERSION, VM_TYPES, abstractaccount, accountAuthInfo, addressesFrom20, algorithmName, amm, attachHybridExtension, authz, bank, be64, bech32ToHex, bridge, bridgeAttestationSignBytes, bridgeAttestationSignBytesV1, bridgeAttestationSignBytesV2, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildMetaMaskExecuteCosmos, buildMetaMaskExecuteEvm, buildPhantomExecuteCosmos, buildPhantomExecuteEvm, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, clearSignBytesCache, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, cosmosAuthSignBytes, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, derivePqcLegacy, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmAuthSignBytes, evmToQor, execute, executeCosmosMsg, executeEvmMsg, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, fetchSignBytesV2AppliedHeight, fetchSignBytesV2AppliedHeightAny, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, hybridSignBytes, hybridSignBytesV1, hybridSignBytesV2, ibc, instantiate, instantiate2, isChecksumAddress, isHybridSignBytesRejection, isLegacySignBytesChain, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, lengthPrefixed, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, migrationSignBytes, migrationSignBytesV1, migrationSignBytesV2, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, codegen_exports as qorechainTypes, queryContractSmart, rdk, registerEthAuthenticatorMsg, requestFaucet, resolveSignBytesVersion, revokeAuthenticatorMsg, ripemd160, ripemd160Hex, rlconsensus, rotatePqcKeyMsg, rotatePqcKeyMsgFromMnemonic, rotationSignBytes, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signBytesVersionFor, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry2 as withRetry };
27041
27049
  //# sourceMappingURL=index.js.map
27042
27050
  //# sourceMappingURL=index.js.map