@monolythium/core-sdk 0.2.0 → 0.2.2

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.
@@ -1,5 +1,5 @@
1
1
  import { JsonRpcApiProvider, JsonRpcPayload, JsonRpcResult, JsonRpcError, AbstractSigner, Provider, TransactionRequest, TypedDataDomain, TypedDataField, BaseWallet, Signer } from 'ethers';
2
- import { D as RpcClient, cT as RpcClientOptions, d3 as TransactionReceipt, au as CallRequest } from '../native-events-BEkkGoak.cjs';
2
+ import { D as RpcClient, cU as RpcClientOptions, d4 as TransactionReceipt, au as CallRequest } from '../native-events-CA0yrnj-.cjs';
3
3
  import { b as MonolythiumNetworkConfig } from '../network-BK2u9br2.cjs';
4
4
  export { c as MONOLYTHIUM_NETWORKS, M as MONOLYTHIUM_TESTNET_CHAIN_ID, a as MONOLYTHIUM_TESTNET_NETWORK_NAME } from '../network-BK2u9br2.cjs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { JsonRpcApiProvider, JsonRpcPayload, JsonRpcResult, JsonRpcError, AbstractSigner, Provider, TransactionRequest, TypedDataDomain, TypedDataField, BaseWallet, Signer } from 'ethers';
2
- import { D as RpcClient, cT as RpcClientOptions, d3 as TransactionReceipt, au as CallRequest } from '../native-events-BEkkGoak.js';
2
+ import { D as RpcClient, cU as RpcClientOptions, d4 as TransactionReceipt, au as CallRequest } from '../native-events-CA0yrnj-.js';
3
3
  import { b as MonolythiumNetworkConfig } from '../network-BK2u9br2.js';
4
4
  export { c as MONOLYTHIUM_NETWORKS, M as MONOLYTHIUM_TESTNET_CHAIN_ID, a as MONOLYTHIUM_TESTNET_NETWORK_NAME } from '../network-BK2u9br2.js';
5
5
 
@@ -750,7 +750,7 @@ var RpcClient = class _RpcClient {
750
750
  async web3Sha3(data) {
751
751
  return this.call("web3_sha3", [data]);
752
752
  }
753
- // ---- lyth_* (Law §13.2 native namespace) --------------------------
753
+ // ---- lyth_* native namespace --------------------------------------
754
754
  /** `lyth_listProviders` — paged registry enumeration. */
755
755
  async lythListProviders(capabilityMask, cursor = null, limit = 100) {
756
756
  return this.call("lyth_listProviders", [capabilityMask, cursor, limit]);
@@ -982,14 +982,26 @@ var RpcClient = class _RpcClient {
982
982
  async lythCurrentRound() {
983
983
  return normalizeRoundInfo(await this.call("lyth_currentRound", []));
984
984
  }
985
+ /** `lyth_getTransactionCount` — native sender nonce. */
986
+ async lythGetTransactionCount(address) {
987
+ return parseRpcBigint(
988
+ await this.call("lyth_getTransactionCount", [
989
+ sdkTypedAddress(address, "user", "address")
990
+ ]),
991
+ "lyth_getTransactionCount"
992
+ );
993
+ }
994
+ /** `lyth_executionUnitPrice` — native execution-unit price in lythoshi. */
995
+ async lythExecutionUnitPrice() {
996
+ return normalizeExecutionUnitPriceResponse(
997
+ await this.call("lyth_executionUnitPrice", [])
998
+ );
999
+ }
985
1000
  /** `lyth_peerSummary` — public-safe aggregate peer-network diagnostics. */
986
1001
  async lythPeerSummary() {
987
1002
  return this.call("lyth_peerSummary", []);
988
1003
  }
989
- /**
990
- * `lyth_listActivePrecompiles` — milestone-gated precompile catalogue
991
- * (OI-0170 / ADR-0015 §5).
992
- */
1004
+ /** `lyth_listActivePrecompiles` — native precompile catalogue. */
993
1005
  async lythListActivePrecompiles(block = "latest") {
994
1006
  return this.call("lyth_listActivePrecompiles", [encodeBlockSelector(block)]);
995
1007
  }
@@ -1907,6 +1919,34 @@ function normalizeRoundInfo(value) {
1907
1919
  height: parseRpcBigint(row["height"], "round height")
1908
1920
  };
1909
1921
  }
1922
+ function normalizeExecutionUnitPriceResponse(value) {
1923
+ if (!value || typeof value !== "object") {
1924
+ throw SdkError.malformed("execution unit price response must be an object");
1925
+ }
1926
+ const row = value;
1927
+ return {
1928
+ executionUnitPriceLythoshi: parseRpcBigint(
1929
+ fieldAlias(row, ["executionUnitPriceLythoshi", "execution_unit_price_lythoshi"]),
1930
+ "executionUnitPriceLythoshi"
1931
+ ).toString(),
1932
+ basePricePerExecutionUnitLythoshi: parseRpcBigint(
1933
+ fieldAlias(row, [
1934
+ "basePricePerExecutionUnitLythoshi",
1935
+ "base_price_per_execution_unit_lythoshi"
1936
+ ]),
1937
+ "basePricePerExecutionUnitLythoshi"
1938
+ ).toString(),
1939
+ priorityTipLythoshi: parseRpcBigint(
1940
+ fieldAlias(row, ["priorityTipLythoshi", "priority_tip_lythoshi"]),
1941
+ "priorityTipLythoshi"
1942
+ ).toString(),
1943
+ blockNumber: parseRpcNumberNullable(
1944
+ fieldAlias(row, ["blockNumber", "block_number"]),
1945
+ "blockNumber"
1946
+ ),
1947
+ source: readStringField(row, ["source"], "execution unit price source")
1948
+ };
1949
+ }
1910
1950
  function normalizeMempoolSnapshot(value) {
1911
1951
  if (!value || typeof value !== "object") {
1912
1952
  throw SdkError.malformed("mempool snapshot must be an object");
@@ -1923,6 +1963,19 @@ function normalizeMempoolSnapshot(value) {
1923
1963
  bytes_by_class: bytesByClass.map((v, i) => parseRpcBigint(v, `mempool bytes_by_class[${i}]`))
1924
1964
  };
1925
1965
  }
1966
+ function fieldAlias(record, keys) {
1967
+ for (const key of keys) {
1968
+ if (Object.prototype.hasOwnProperty.call(record, key)) return record[key];
1969
+ }
1970
+ return void 0;
1971
+ }
1972
+ function readStringField(record, keys, label) {
1973
+ const value = fieldAlias(record, keys);
1974
+ if (typeof value !== "string" || value.trim().length === 0) {
1975
+ throw SdkError.malformed(`${label} must be a non-empty string`);
1976
+ }
1977
+ return value.trim();
1978
+ }
1926
1979
  function normalizeCapabilitiesResponse(value) {
1927
1980
  return {
1928
1981
  ...value,