From 63c977091735ccdccd1e85a4f06fd63892184f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Tue, 17 Mar 2026 17:03:22 +0100 Subject: [PATCH 1/5] fix(lib): processing curated list of supported networks --- src/lib/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 428d154a..603e0c72 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -195,7 +195,7 @@ export function getEvmNetworkAddresses(network: string): any { export function getEvmNetworkByChainId(chainId: number): string | undefined { const found = Object.entries(helpers.supportedNetworks()).find( - ([, config]: [string, any]) => config?.network_id.toString() === chainId.toString(), + ([, config]: [string, any]) => config?.chainId?.toString() === chainId?.toString(), ); if (found) return found[0]; else return undefined; @@ -205,7 +205,7 @@ export function getEvmNetworkId(network: string): number | undefined { const found = Object.entries(helpers.supportedNetworks()).find( ([key]: [string, any]) => network && key.toLowerCase() === network.toLowerCase(), ); - if (found) return (found[1] as any)?.network_id; + if (found) return (found[1] as any)?.chainId; else return undefined; } From 09054ea51ba05cee448038a81ceedcd2a8d715c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Tue, 17 Mar 2026 17:08:05 +0100 Subject: [PATCH 2/5] feat(cli): witeth priceFeeds --verbose --- src/bin/cli/priceFeeds.cjs | 48 +++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/src/bin/cli/priceFeeds.cjs b/src/bin/cli/priceFeeds.cjs index 461a1c70..0ba75bbd 100644 --- a/src/bin/cli/priceFeeds.cjs +++ b/src/bin/cli/priceFeeds.cjs @@ -13,7 +13,7 @@ module.exports = async (options = {}, args = []) => { const { network } = witOracle; helpers.traceHeader(`${network.toUpperCase()}`, helpers.colors.lcyan); - let { target } = options; + let { target, verbose } = options; let chosen = false; if (!target) { const { apps } = utils.getEvmNetworkAddresses(network); @@ -98,25 +98,29 @@ module.exports = async (options = {}, args = []) => { if (pf?.oracle && pf.oracle.class === "Witnet") { const bytecode = await registry.lookupRadonRequestBytecode(pf.oracle.sources); const request = Witnet.Radon.RadonRequest.fromBytecode(bytecode); - try { - const dryrun = JSON.parse(await request.execDryRun({ verbose: true })); - // const result = dryrun.tally.result - providers = request.sources - .map((source, index) => { - let authority = source.authority.split(".").slice(-2)[0]; - authority = authority[0].toUpperCase() + authority.slice(1); - return dryrun.retrieve[index].result?.RadonInteger - ? helpers.colors.mmagenta(authority) - : helpers.colors.red(authority); - }) - .sort((a, b) => helpers.colorstrip(a).localeCompare(helpers.colorstrip(b))); - } catch (_err) { - providers = request.sources - .map((source) => { - const authority = source.authority.split(".").slice(-2)[0]; - return helpers.colors.magenta(authority[0].toUpperCase() + authority.slice(1)); - }) - .sort((a, b) => helpers.colorstrip(a).localeCompare(helpers.colorstrip(b))); + if (verbose) { + providers = [request.radHash]; + } else { + try { + const dryrun = JSON.parse(await request.execDryRun({ verbose: true })); + // const result = dryrun.tally.result + providers = request.sources + .map((source, index) => { + let authority = source.authority.split(".").slice(-2)[0]; + authority = authority[0].toUpperCase() + authority.slice(1); + return dryrun.retrieve[index].result?.RadonInteger + ? helpers.colors.mmagenta(authority) + : helpers.colors.red(authority); + }) + .sort((a, b) => helpers.colorstrip(a).localeCompare(helpers.colorstrip(b))); + } catch (_err) { + providers = request.sources + .map((source) => { + const authority = source.authority.split(".").slice(-2)[0]; + return helpers.colors.magenta(authority[0].toUpperCase() + authority.slice(1)); + }) + .sort((a, b) => helpers.colorstrip(a).localeCompare(helpers.colorstrip(b))); + } } } else if (pf?.oracle) { providers = [ @@ -164,7 +168,9 @@ module.exports = async (options = {}, args = []) => { "FRESHNESS:", options["trace-back"] ? `DATA WITNESSING TRAIL ON ${helpers.colors.lwhite(`WITNET ${utils.isEvmNetworkMainnet(network) ? "MAINNET" : "TESTNET"}`)}` - : ":DATA PROVIDERS", + : verbose + ? ":RADON REQUEST HASH" + : ":DATA PROVIDERS", ], }, ); From 335199ebf6eede52d1658e5eb2c26d1e6f5bcad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Thu, 19 Mar 2026 14:40:40 +0100 Subject: [PATCH 3/5] chore: README full review --- README-draft.md | 204 --------------- README.md | 533 +++++++++++++++++++++++++++++++++++++++ docs/cli-appendix.md | 252 ++++++++++++++++++ docs/javascript-guide.md | 53 ++++ docs/operator-guide.md | 62 +++++ docs/solidity-guide.md | 282 +++++++++++++++++++++ 6 files changed, 1182 insertions(+), 204 deletions(-) delete mode 100644 README-draft.md create mode 100644 README.md create mode 100644 docs/cli-appendix.md create mode 100644 docs/javascript-guide.md create mode 100644 docs/operator-guide.md create mode 100644 docs/solidity-guide.md diff --git a/README-draft.md b/README-draft.md deleted file mode 100644 index 9a335731..00000000 --- a/README-draft.md +++ /dev/null @@ -1,204 +0,0 @@ -# Wit/Oracle Solidity Framework -- Contracts, SDK and CLI tools for EVM-compatible chains - -The **Wit/Oracle Solidity Framework** allows you to easily interact with the Wit/Oracle contracts framework, as deployed on a wide selection of **EVM-compatible chains**, either from Solidity smart contracts of your own, as well as offchain environments, automation scripts and Web3 apps. - -## โœจ Overview - -This package contains: - -### Solidity contracts - -### Javascript library -- A **Javascript library** allowing scripts to introspect the set of supported networks, ABIs, addresses and settings, as well as deployed Radon assets. It provides also wrapping Javascript classes for interacting with the Wit/Oracle Framework artifacts. - -### CLI binaries - -#### `npx witnet-solidity` - - List supported EVM ecosystems and chains where the Wit/Oracle Contract Framework is available. - - List addresses of the Wit/Oracle Framework artifacts for each supported chain. - - Build, leverage, test and deploy your own customized Witnet-compliant data queries. - - Show latest updates of the price feeds subsidized by the Witnet Foundation on each supported chain. - - Show latest data queries actively pulled from smart contracts via the Wit/Oracle Framework. - - Show latest randomize requests posted to Wit/Randomness contracts. - - Force randomize requests into specific Wit/Randomness contracts. - - Show latest data reports recently pushed into specific Witnet-aware consuming contracts. - - Push notarized data on Witnet into specific Witnet-aware consuming contracts. - - Build Solidity contracts capable of interacting with the Wit/Oracle Framework contracts. - -#### `npx witnet` - - Lorem ipsum. - - -> *This package imports as a runtime dependency the [**Witnet SDK**](https://github.com/witnet/witnet-toolkit) package, so both the SDK library and the CLI binary (`npx witsdk`) get installed and ready to use right out of the box.* - -## ๐Ÿ“ฆ Installation - -```bash -$ npm install --save @witnet/solidity -``` - -### Interact with Wit/Oracle appliances on EVM-compatible networks - ```typescript - import { assets, ethers, utils, WitOracle } from "@witnet/ethers" - ``` -### Interact with the Witnet network by using the embedded Witnet SDK library - ```typescript - import { Witnet } from "@witnet/sdk" - ``` - -## โš™๏ธ Requirements - -- Node.js >= 20 -- Sufficient balance of the EVM's gas currency for transacting in your preferred EVM-compatible network. -- Sufficient $WIT balance for notarizing real-world data requests in Witnet. - -## ๐Ÿ”ง Configuration - -Both the CLI and the Javascript library can be configured using a **.env** file or by setting this environment variable: -```bash - ETHRPC_PRIVATE_KEYS=["your_eth_private_key_1", ..., "your_eth_private_key_n"] -``` -Additionally, you can settle your preferred ETH/RPC provider when launching the local gateway (see below). - -## ๐Ÿงช Supported EVM-compatible Networks - -> *Please, visit the [Witnet Docs site](https://docs.witnet.io/smart-contracts/supported-chains) to get an up-to-date list of supported EVM chains.* - -## ๐Ÿ› ๏ธ Usage - -### CLI binary - -```bash -$ npx witeth [] [] [] [--help] -``` - -> *You need to have a local **ETH/RPC gateway** running in order to get access to extra commands. You will only be able to interact with the Wit/Oracle appliances if you connect to a supported EVM network first.* - ----- -#### `npx witeth networks` -Lists EVM networks where the Wit/Oracle Contract Framework is supported. - -**Flags**: -- `--mainnets`: Just list the mainnets. -- `--testnets`: Just list the testnets. - ----- -#### `npx witeth gateway ` -Launches a local ETH/RPC signing gateway to the specified `evm_network`, listening on port 8545 if no otherwise specified. - -**Options**: - - `--port`: Port where the new gateway should be listening on. - - `--remote`: URL of the ETH/RPC remote provider to use instead of the gateway's default for the specified network. - -> *Launch a gateway to your preferred EVM network on a different terminal so you can augment the available commands of the `witeth` CLI binary. If you launch the gateway on a port other than default's, you'll need to specify `--port ` when invoking other commands of the `witeth` binary.* - ----- -#### `npx witeth accounts` -Lists set of local EVM signing addresses set up in the gateway, as well as their current balance of the EVM's native currency. - ----- -#### `npx witeth assets [ ..]` -Shows the Radon assets within your project that have been formally verified and deployed into the connected EVM network. It also allows you to verify and deploy additional Radon assets. - -**Flags**: -- `--all`: List all available Radon assets, even if not yet deployed. -- `--decode`: Decode selected Radon assets, using the currently deployed bytecode. -- **`--deploy`**: Deploy or replace the selected assets, on the current EVM network. -- `--dry-run`: Dry-run selected Radon assets, using the currently deployed bytecode (superseded `--decode`). -- `--legacy`: Filter Radon assets to those declared within the **witnet/assets** folder of your project. - -**Options**: -- `--module`: Specify the NPM package where to fetch declared Radon assets from (supersedes `--legacy`). -- `--signer`: EVM signer address to use when deploying Radon assets, other than the gateway's default. - ----- -#### `npx witeth contracts` -Lists addresses of all available Wit/Oracle Framework artifacts. - -**Flags**: -- `--templates`: Include parameterized Radon templates deployed specifically for this project, if any. - ----- -#### `npx witeth priceFeeds` -Shows latest updates of the price feeds supported by the specified Wit/PriceFeeds appliance. - -For each price feed the following data is shown: -- The symbol (e.g. Price-ETH/USD-6). -- Last updated price. -- Time elapsed since the last price update. -- API's where price updates are extract from, and aggregated together. - -**Flags**: -- `--trace-back`: Trace witnessing acts on Witnet that actually provided latest updates for each price feed. - ----- -#### `npx witeth queries` -Shows latest Wit/Oracle queries actively pulled from smart contracts. - -**Flags**: -- `--voids`: Include queries that got eventually deleted by their respective requesters. -- `--trace-back`: Trace the witnessing acts on Witnet that attended each listed query. - -**Options**: -- `--filter-radHash`: Filter queries referring specified RAD hash. -- `--filter-requester`: Filter queries triggered from the specified EVM address. -- `--since`: List queries since the specified EVM block number (default: -5000). -- `--limit`: Limit number of listed records (default: 64). -- `--offset`: Filter first records before listing. - ----- -#### `npx witeth randomness` -Shows randomize requests posted on the selected Wit/Randomness appliance. It also allows to force new randomize requests. - -**Flags**: -- **`--randomize`**: Pay for a new randomize request. -- `--trace-back`: Trace the witnessing acts on Witnet that ultimately provided randomness for each randomization request. - -**Options**: -- `--since`: List randomize requests since the specified EVM block number (default: -5000). -- `--limit`: Limit number of listed records (default: 64). -- `--offset`: Filter first records before listing. -- `--gasPrice`: Max. EVM gas price when requesting a new randomize. -- `--signer`: EVM signer address that will pay for the new randomize, other than gateway's default. - ----- -#### `npx witeth reports` -Shows verified data reports pushed into `IWitOracleConsumer` contracts. It also allows to push the results of Witnet-notarized queries into consuming contracts (no fees required). - -**Flags**: -- `--parse`: Decode the CBOR-encoded data that got reported. -- `--trace-back`: Trace the notarized query on Witnet that produced the reported data. - -**Options**: -- `--filter-consumer`: Only show data reported into the specified EVM address. -- `--filter-requester`: Only show data reported from the specified EVM address. -- `--since`: List pushed data reports since the specified EVM block number (default: -5000). -- `--limit`: Limit number of listed records (default: 64). -- `--offset`: Filter first records before listing. -- **`--push`**: Push the result to some finalized query in Witnet. -- `--into`: The EVM address where to push the data query result. - ---- -### Javascript library -> *Please, find Javascript and Typescript code snippets in the [Witnet Docs site](https://docs.witnet.io/).* - -## ๐Ÿงฑ Built With -- Axios -- Ethers v6 -- [ETH/RPC Gateway](https://npmjs.com/ethrpc-gateway) -- Node.js -- [Witnet SDK](https://npmjs.com/@witnet/sdk) - -## ๐Ÿ” Security -- Do not share your private keys. -- Use trusted RPC endpoints when using third-party providers. - -## ๐Ÿ“š Documentation -Learn more about Witnet, the $WIT coin and the Wit/Oracle Appliance Framework for smart contracts at: - -๐Ÿ‘‰ https://docs.witnet.io -๐Ÿ‘‰ https://witnet.io -๐Ÿ‘‰ https://witnet.foundation/ - -## ๐Ÿงพ License -MIT ยฉ 2025 โ€” Maintained by the [Witnet Project](https://github.com/witnet). diff --git a/README.md b/README.md new file mode 100644 index 00000000..21bc41d7 --- /dev/null +++ b/README.md @@ -0,0 +1,533 @@ +# Wit/Oracle Solidity Framework + +Contracts, wrappers, and CLI tooling for running and integrating the Wit/Oracle stack on EVM-compatible networks. + +[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/witnet/witnet-solidity-bridge) + +## Quick Start By Persona + +### For Operators (5 minutes) + +1. Install dependencies: + +```bash +pnpm install +``` + +2. List supported chains: + +```bash +npx witeth networks +``` + +3. Start a local signing gateway connected to your target network: + +```bash +npx witeth gateway +``` + +4. In another terminal, inspect framework contracts in that chain: + +```bash +npx witeth framework --verbose +``` + +5. For deployments or upgrades, use your internal deployment automation/playbook: + +```bash + +``` + +### For Solidity Developers (5 minutes) + +1. Install package: + +```bash +npm install @witnet/solidity +``` + +2. Browse subsidized feeds: + +```bash +npx witeth priceFeeds +``` + +3. Browse randomness requests: + +```bash +npx witeth randomness +``` + +4. Inspect oracle pull queries and pushed reports: + +```bash +npx witeth queries --limit 20 +npx witeth reports --limit 20 --parse +``` + +5. Inspect and dry-run Radon assets: + +```bash +npx witeth assets --all --decode +npx witeth assets --dry-run +``` + +### For JavaScript Developers (5 minutes) + +1. Install dependencies: + +```bash +npm install @witnet/solidity ethers +``` + +2. Instantiate wrappers from an ethers JsonRpcProvider: + +```ts +import { ethers, utils } from "@witnet/solidity"; + +const provider = new ethers.JsonRpcProvider(process.env.ETH_RPC_URL!); +const framework = await utils.fetchWitOracleFramework(provider); + +console.log(Object.keys(framework)); +``` + +3. Build a strongly typed WitOracle wrapper: + +```ts +import { WitOracle } from "@witnet/solidity"; + +const witOracle = await WitOracle.fromEthRpcProvider(provider); +const randomness = await witOracle._getWitRandomness(); +console.log(await randomness.getEvmChainId()); +``` + +## Documentation Map + +- Operator deep dive: [docs/operator-guide.md](docs/operator-guide.md) +- Solidity deep dive: [docs/solidity-guide.md](docs/solidity-guide.md) +- JavaScript deep dive: [docs/javascript-guide.md](docs/javascript-guide.md) +- CLI appendix (examples, output shape, failures): [docs/cli-appendix.md](docs/cli-appendix.md) + +## Operator Guide + +### Fine-Tune Contract Implementations By Target Network + +Network-specific behavior is controlled by your network metadata, artifact mapping, and deployment specs sources of truth. + +Recommended decision flow for WitOracle implementation selection: + +1. Start from your default implementation mapping. +2. Add ecosystem override when many chains share behavior. +3. Add chain-level override only when strictly needed. +4. Keep deployment spec changes minimal and explicit. + +### Upgrade Framework In An Already Supported Network + +Preflight: + +```bash +pnpm run fmt +pnpm run compile +``` + +Run selective upgrade using your internal release process for the targeted artifacts. + +Run full upgrade only through your approved change-management process. + +Validate upgraded state: + +```bash +npx witeth gateway +npx witeth framework --verbose +``` + +### Add And Deploy A New Network + +1. Add the network to your supported-network catalog using the name pattern ecosystem:chain. +2. Add artifact overrides when defaults are not enough. +3. Add deployment specs for mutables, immutables, dependencies, or libs. +4. Deploy using your approved deployment automation. + +5. Verify and smoke-test: + +```bash +npx witeth gateway +npx witeth framework --verbose +npx witeth priceFeeds +npx witeth randomness +``` + +## Solidity Developer Guide + +### Price Feeds + +#### List supported price feeds + +You can enumerate supported feeds both on-chain and from CLI. + +Solidity path: + +- Call `IWitPriceFeeds.lookupPriceFeeds()`. +- Return value is `PriceFeedInfo[]`, where each item includes: +- `id`: 32-byte feed id. +- `exponent`: decimals exponent for interpreting price values. +- `symbol`: human-readable caption. +- `mapper`: mapping definition when feed is derived from dependencies. +- `oracle`: oracle target and source identifiers. +- `updateConditions`: heartbeat, deviation, witness, and callback settings. +- `lastUpdate`: last known `Price` (`exponent`, `price`, `deltaPrice`, `timestamp`, `trail`). + +CLI path: + +- Run `npx witeth priceFeeds`. +- CLI table highlights: +- `ID4`: 4-byte identifier used by native `IWitPriceFeeds` reads. +- `CAPTION`: price feed caption/symbol. +- `FRESHNESS`: relative age of last update (for example, "2 minutes ago"). +- `DATA PROVIDERS`: upstream providers or composed dependencies used for the feed. + +#### Consume subsidized feeds through WitPriceFeeds + +You can read the same subsidized feed through four compatibility paths: + +1. Witnet-native interface (`IWitPriceFeeds`) +2. ERC-2362 compatibility (`IERC2362`-style `valueFor(bytes32)`) +3. Pyth-adapted interface (`IWitPyth` methods) +4. Chainlink-adapted interface (create adapter then consume `IWitPythChainlinkAggregator` / Chainlink V3 methods) + +##### 1) Witnet-native way (`IWitPriceFeeds`) + +Methods: + +- `getPrice(ID4 id4)` +- `getPriceNotOlderThan(ID4 id4, uint24 age)` +- `getPriceUnsafe(ID4 id4)` + +Arguments: + +- `id4`: 4-byte feed identifier, usually derived from caption (for example via `computeID4("Price-ETH/USD-6")`). +- `age`: max accepted staleness in seconds (`getPriceNotOlderThan` only). + +Possible reverts: + +- `PriceFeedNotFound()` when the feed is not supported. +- `StalePrice()` on stale updates (`getPrice`, `getPriceNotOlderThan`). +- `InvalidGovernanceTarget()` if EMA-governed conditions are unmet for the feed. + +Expected return: + +- `Price` struct with `exponent`, `price`, `deltaPrice`, `timestamp`, `trail`. +- Effective numeric value is typically interpreted as `price * 10^exponent`. + +##### 2) ERC-2362 way (`valueFor(bytes32)`) + +Method: + +- `valueFor(bytes32 id)` + +Arguments: + +- `id`: 32-byte feed id (typically from `computeID32(caption)`). + +Possible reverts: + +- Typically no sanity-check revert for stale/missing values in this path. +- In normal operation, status codes signal health instead of reverting. + +Expected return: + +- `(int256 value, uint256 timestamp, uint256 status)`. +- Status semantics in current implementation: +- `200`: fresh value. +- `400`: stale value. +- `404`: feed not found / no value yet. + +##### 3) Pyth-adapted way (`IWitPyth`) + +Methods: + +- `getPrice(bytes32 id)` +- `getPriceNotOlderThan(bytes32 id, uint64 age)` +- `getPriceUnsafe(bytes32 id)` +- `getEmaPrice(bytes32 id)` +- `getEmaPriceNotOlderThan(bytes32 id, uint64 age)` +- `getEmaPriceUnsafe(bytes32 id)` + +Arguments: + +- `id`: 32-byte feed id (`IWitPyth.ID`, backed by `bytes32`). +- `age`: max accepted staleness in seconds for `*NotOlderThan` variants. + +Possible reverts: + +- `PriceFeedNotFound()` when feed is unsupported. +- `StalePrice()` on stale values in sanity-checked variants. +- `InvalidGovernanceTarget()` for invalid EMA/governance configuration. + +Expected return: + +- `PythPrice` struct: `price` (`int64`), `conf` (`uint64`), `expo` (`int32`), `publishTime` (`uint`). +- `Unsafe` variants prioritize availability over freshness guarantees. + +##### 4) Chainlink-adapted way (`IWitPythChainlinkAggregator`) + +Flow: + +1. Call `IWitPriceFeeds.createChainlinkAggregator(string caption)`. +2. Use returned aggregator address through `IWitPythChainlinkAggregator` (which extends Chainlink V3 interface). + +Key methods after creation: + +- Chainlink V3 reads: `latestRoundData()`, `getRoundData(uint80)`, `decimals()`, `description()`, `version()`. +- Adapter metadata: `id4()`, `priceId()`, `symbol()`, `witOracle()`. + +Arguments: + +- `caption`: feed caption used in WitPriceFeeds (for example `Price-ETH/USD-6`). +- `roundId`: Chainlink-compatible round selector when using `getRoundData`. + +Possible reverts: + +- `createChainlinkAggregator` reverts if caption is not supported. +- Read methods may bubble up underlying feed lookup failures. + +Expected return: + +- Chainlink-compatible tuple from round methods: +- `(roundId, answer, startedAt, updatedAt, answeredInRound)`. +- `answer` is the price value adapted to Chainlink-style consumers. + +##### Compact Solidity Example (all 4 paths) + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import { IWitPriceFeeds, IWitPriceFeedsTypes } from "@witnet/solidity/contracts/interfaces/IWitPriceFeeds.sol"; +import { IWitPyth } from "@witnet/solidity/contracts/interfaces/legacy/IWitPyth.sol"; +import { IWitPythChainlinkAggregator } from "@witnet/solidity/contracts/interfaces/legacy/IWitPythChainlinkAggregator.sol"; + +interface IERC2362 { + function valueFor(bytes32 id) external view returns (int256 value, uint256 timestamp, uint256 status); +} + +contract FeedReadExamples { + IWitPriceFeeds public immutable feeds; + + constructor(address feedsAddress) { + feeds = IWitPriceFeeds(feedsAddress); + } + + // 1) Witnet-native + function readNative(bytes4 id4) + external + view + returns (IWitPriceFeedsTypes.Price memory checked, IWitPriceFeedsTypes.Price memory unsafe_) + { + checked = feeds.getPrice(IWitPriceFeedsTypes.ID4.wrap(id4)); + unsafe_ = feeds.getPriceUnsafe(IWitPriceFeedsTypes.ID4.wrap(id4)); + } + + // 2) ERC-2362 compatibility + function readErc2362(bytes32 id32) external view returns (int256 value, uint256 timestamp, uint256 status) { + return IERC2362(address(feeds)).valueFor(id32); + } + + // 3) Pyth-adapted compatibility + function readPyth(bytes32 id32) + external + view + returns (IWitPyth.PythPrice memory spot, IWitPyth.PythPrice memory ema) + { + IWitPyth.ID id = IWitPyth.ID.wrap(id32); + spot = feeds.getPriceNotOlderThan(id, 300); + ema = feeds.getEmaPriceUnsafe(id); + } + + // 4) Chainlink-adapted compatibility + function createAndReadChainlink(string calldata caption) + external + returns (address aggregator, int256 answer, uint256 updatedAt) + { + aggregator = feeds.createChainlinkAggregator(caption); + (, answer, , updatedAt, ) = IWitPythChainlinkAggregator(aggregator).latestRoundData(); + } +} +``` + +##### Production pattern: read from pre-created Chainlink adapter + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import { IWitPythChainlinkAggregator } from "@witnet/solidity/contracts/interfaces/legacy/IWitPythChainlinkAggregator.sol"; + +contract FeedReadChainlinkOnly { + IWitPythChainlinkAggregator public immutable adapter; + + constructor(address adapterAddress) { + adapter = IWitPythChainlinkAggregator(adapterAddress); + } + + function readLatest() + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) + { + return adapter.latestRoundData(); + } + + function metadata() + external + view + returns (bytes4 id4, bytes32 priceId, string memory symbol, address witOracle, uint8 decimals) + { + return (adapter.id4(), adapter.priceId(), adapter.symbol(), adapter.witOracle(), adapter.decimals()); + } +} +``` + +#### Permissionless reporting under your own premises + +See the @witnet/price-feeds README: + +- https://github.com/witnet/price-feeds/blob/master/README.md + +#### Get your contracts reported when a new price update is available + +See the @witnet/price-feeds README: + +- https://github.com/witnet/price-feeds/blob/master/README.md + +#### Introspect data sources, scripts, and history via CLI + +See the @witnet/price-feeds README: + +- https://github.com/witnet/price-feeds/blob/master/README.md + +### Randomness + +#### Pull randomness from a smart contract + +Call randomize on the WitRandomness contract from your contract flow, then consume finalized entropy once available. + +#### Pull randomness from off-chain + +```bash +npx witeth randomness --target --randomize --signer +npx randomizer --target +``` + +#### Callback-based randomness consumers + +Pattern: + +1. Clone a WitRandomness instance: + +```bash +npx witeth randomness --target --clone --signer +``` + +2. Trigger randomization by bot or by randomize calls. +3. Implement IWitRandomnessConsumer callback entrypoint in your consumer contract. + +### Custom Feeds (Radon Requests) + +Radon Request is the programmable query definition in Witnet: sources, transforms, aggregation, and commit/reveal consensus knobs. + +#### Build invariable and parameterized requests + +- Solidity path: verify and refer requests from contracts in this framework. +- JavaScript path: compose assets using @witnet/sdk. + +#### Dry-run, verify, and inspect from CLI + +```bash +npx witeth assets --all --decode +npx witeth assets --dry-run +npx witeth assets --deploy +``` + +#### Pull by verified RAD hash and validate pushed updates + +Use queries and reports commands to inspect pull and push workflows by RAD hash: + +```bash +npx witeth queries --filter-radHash +npx witeth reports --filter-radHash --parse +``` + +## JavaScript Developer Guide + +### Functions in @witnet/solidity/utils + +Commonly used functions: + +- getNetworkTagsFromString +- fetchWitOracleFramework +- fetchEvmNetworkFromProvider +- getEvmNetworkAddresses +- getEvmNetworkByChainId +- getEvmNetworkId +- getEvmNetworkSymbol +- getEvmNetworks +- isEvmNetworkMainnet +- isEvmNetworkSupported +- abiDecodeQueryStatus +- abiEncodeDataPushReport +- abiEncodeDataPushReportMessage +- abiEncodeDataPushReportDigest +- abiEncodePriceFeedUpdateConditions +- abiEncodeWitOracleQueryParams +- abiEncodeRadonAsset + +### Instantiate wrappers for all available artifacts from a provider + +```ts +import { ethers, utils } from "@witnet/solidity"; + +const provider = new ethers.JsonRpcProvider(process.env.ETH_RPC_URL!); +const framework = await utils.fetchWitOracleFramework(provider); + +for (const [name, artifact] of Object.entries(framework)) { + console.log(name, artifact.address, artifact.class, artifact.semVer); +} +``` + +### Build, check, dry-run, and introspect Radon requests + +1. Build invariable or parameterized Radon definitions with @witnet/sdk. +2. Use CLI for decode and dry-run checks. +3. Inspect trace-back for feeds, queries, and reports to validate end-to-end behavior. + +## CLI Reference + +### Core commands + +- npx witeth networks +- npx witeth gateway +- npx witeth accounts +- npx witeth framework +- npx witeth assets +- npx witeth priceFeeds +- npx witeth queries +- npx witeth randomness +- npx witeth reports +- npx randomizer + +### Useful flags and options + +- --trace-back, --parse, --randomize, --clone, --deploy, --dry-run, --decode, --verbose +- --target, --signer, --filter-radHash, --filter-requester, --filter-consumer, --since, --limit, --offset, --push, --into + +## Troubleshooting + +- Unsupported chain id in CLI usually means your gateway is connected to a network that is not yet configured as supported. +- Missing framework artifacts generally means the selected network has no deployed addresses configured or deployment is incomplete. +- Upgrade no-op with selected artifacts usually indicates same implementation bytecode/version is already active. +- PriceFeeds wrapper fallback to legacy can happen on older deployments that only expose legacy interfaces. + +## License + +MIT diff --git a/docs/cli-appendix.md b/docs/cli-appendix.md new file mode 100644 index 00000000..3722a466 --- /dev/null +++ b/docs/cli-appendix.md @@ -0,0 +1,252 @@ +# CLI Appendix + +Command-by-command examples for Wit/Oracle operators and integrators. + +## Global Notes + +- Most commands expect a local ETH/RPC signing gateway at http://127.0.0.1:8545. +- Start gateway first when running network-bound commands. +- Use --help per command for full usage. + +## 1. networks + +Purpose: list supported EVM networks and their oracle model. + +Examples: + +```bash +npx witeth networks +npx witeth networks --mainnets +npx witeth networks --testnets +``` + +Typical output shape: + +- table with Network, Fee Token, Network Id, Oracle Model, Explorer URL +- final summary line with number of listed networks + +Common failures: + +- no matching rows when over-filtering with --mainnets or --testnets + +## 2. gateway + +Purpose: launch local signing gateway bound to a supported network. + +Examples: + +```bash +npx witeth gateway ethereum:mainnet +npx witeth gateway base:sepolia --port 8546 +npx witeth gateway polygon:mainnet --remote https://your.rpc.url +``` + +Typical output shape: + +- gateway startup logs and provider connection messages + +Common failures: + +- Unsupported network when network key is not in settings +- provider connectivity or auth issues when using --remote + +## 3. accounts + +Purpose: show signer addresses exposed by gateway and their balances. + +Examples: + +```bash +npx witeth accounts +npx witeth accounts --port 8546 +``` + +Typical output shape: + +- table with index, signer address, and native token balance +- total balance row at the end + +Common failures: + +- gateway not reachable at selected port + +## 4. framework + +Purpose: inspect deployed framework artifacts on current chain. + +Examples: + +```bash +npx witeth framework +npx witeth framework --verbose +npx witeth framework WitOracle WitPriceFeeds +npx witeth framework --templates +npx witeth framework --modals +``` + +Typical output shape: + +- table with artifact name, contract address, interface id +- with --verbose includes implementation class and version tag + +Common failures: + +- unsupported chain id if gateway is connected to an unmapped chain +- empty output when there are no deployed artifacts for that network + +## 5. assets + +Purpose: inspect, dry-run, decode, verify, and deploy Radon assets. + +Examples: + +```bash +npx witeth assets --all +npx witeth assets --dry-run +npx witeth assets --decode +npx witeth assets --deploy --signer +npx witeth assets --module --all +``` + +Typical output shape: + +- tree-like selection of discovered assets +- deployment or verification progress logs per retrieval/request/template +- gas usage summary for on-chain operations + +Common failures: + +- No Radon assets declared when module or local assets are missing +- transaction reverts during verify/deploy due to permissions or invalid inputs +- missing signer permissions when --deploy is used + +## 6. priceFeeds + +Purpose: show latest feed values and freshness for a price feed contract. + +Examples: + +```bash +npx witeth priceFeeds +npx witeth priceFeeds --target +npx witeth priceFeeds --trace-back +``` + +Typical output shape: + +- contract headline with class, address, version +- table with feed id, caption, last price, freshness +- last column shows providers or witness trail with --trace-back + +Common failures: + +- target contract not compatible with expected interface +- empty list when no feeds are configured on target + +## 7. queries + +Purpose: list WitOracle query events pulled from smart contracts. + +Examples: + +```bash +npx witeth queries --limit 20 +npx witeth queries --since 0 --limit 50 +npx witeth queries --filter-radHash +npx witeth queries --filter-requester +npx witeth queries --trace-back +npx witeth queries --voids +``` + +Typical output shape: + +- table with query id, requester, cost, rad hash fragment, status +- with --trace-back, table includes Witnet resolution tx hash + +Common failures: + +- no events in selected block window +- invalid address in --filter-requester + +## 8. randomness + +Purpose: list randomness requests, request new randomize, or clone contract. + +Examples: + +```bash +npx witeth randomness +npx witeth randomness --target --randomize --signer +npx witeth randomness --target --clone --signer +npx witeth randomness --trace-back +``` + +Typical output shape: + +- contract headline with class, address, version +- request table with block, requester, gas, cost, TTR, status +- with --trace-back includes witness trail and finalized randomness + +Common failures: + +- signer has insufficient balance to pay fees +- randomize transaction rejected due to gas price or permissions +- target is not a valid WitRandomness contract + +## 9. reports + +Purpose: inspect pushed reports and push finalized Witnet reports to consumers. + +Examples: + +```bash +npx witeth reports --limit 20 +npx witeth reports --parse +npx witeth reports --filter-consumer +npx witeth reports --filter-radHash +npx witeth reports --push --into --signer +npx witeth reports --trace-back +``` + +Typical output shape: + +- table with block, requester, consumer, cost, and reported bytes/data +- with --trace-back includes Witnet witnessing tx hash and time-to-report +- push flow prints digest and proof before sending transaction + +Common failures: + +- invalid WIT_DR_TX_HASH format +- missing --into when using --push +- consumer contract rejects pushed report + +## 10. randomizer bot + +Purpose: schedule and automate randomize requests from off-chain. + +Examples: + +```bash +npx randomizer --target +npx randomizer --target --network base:mainnet --schedule "*/10 * * * *" +npx randomizer --target --max-gas-price 2 --min-balance 0.05 +``` + +Typical output shape: + +- startup info with network, target, signer, schedule +- randomize tx details and post-confirmation witness/finality data +- periodic balance checks + +Common failures: + +- connected to wrong network when --network does not match gateway chain +- invalid cron expression in --schedule +- low signer balance under --min-balance +- high gas price above --max-gas-price causing postponement + +## Troubleshooting Patterns + +- If command says unsupported chain id, confirm gateway chain and supported-network configuration. +- If command finds no artifacts, verify the active network has deployed framework addresses configured. +- If PowerShell blocks npm scripts due to execution policy, run npm.cmd or npx.cmd equivalents. diff --git a/docs/javascript-guide.md b/docs/javascript-guide.md new file mode 100644 index 00000000..0bd22cf1 --- /dev/null +++ b/docs/javascript-guide.md @@ -0,0 +1,53 @@ +# JavaScript Developer Guide + +This guide explains utilities and wrappers exposed by @witnet/solidity. + +## 1. Utilities + +Main utilities exported from @witnet/solidity/utils include: + +- fetchWitOracleFramework +- fetchEvmNetworkFromProvider +- getEvmNetworkByChainId +- getEvmNetworkAddresses +- getEvmNetworks +- abiDecodeQueryStatus +- abiEncodeDataPushReport +- abiEncodeDataPushReportMessage +- abiEncodeDataPushReportDigest +- abiEncodePriceFeedUpdateConditions +- abiEncodeWitOracleQueryParams +- abiEncodeRadonAsset + +## 2. Instantiate wrappers from ethers JsonRpcProvider + +```ts +import { ethers, utils, WitOracle } from "@witnet/solidity"; + +const provider = new ethers.JsonRpcProvider(process.env.ETH_RPC_URL!); + +const network = await utils.fetchEvmNetworkFromProvider(provider); +console.log(network); + +const framework = await utils.fetchWitOracleFramework(provider); +console.log(Object.keys(framework)); + +const witOracle = await WitOracle.fromEthRpcProvider(provider); +const priceFeeds = await witOracle._getWitPriceFeeds(); +const randomness = await witOracle._getWitRandomness(); + +console.log(priceFeeds.address, randomness.address); +``` + +## 3. Radon workflows from JS plus CLI validation + +1. Build invariable and parameterized Radon assets with @witnet/sdk. +2. Use CLI to decode and dry-run before deployment. +3. Use CLI trace-back options to inspect data sources and witness trails. + +```bash +npx witeth assets --all --decode +npx witeth assets --dry-run +npx witeth priceFeeds --trace-back +npx witeth queries --trace-back --limit 20 +``` diff --git a/docs/operator-guide.md b/docs/operator-guide.md new file mode 100644 index 00000000..f062b2ad --- /dev/null +++ b/docs/operator-guide.md @@ -0,0 +1,62 @@ +# Operator Guide + +This guide is for maintainers deploying, upgrading, and operating the Wit/Oracle Framework on EVM networks. + +## 1. Configuration Surfaces + +- Network metadata: chain ids, fee token info, explorer endpoints. +- Artifact mapping: implementation selection per base, ecosystem, and chain. +- Deployment specs: mutables, immutables, dependencies, libs, and vanity. + +## 2. Fine-Tuning Implementations Per Network + +### Decision checklist + +1. Does the network require a special WitOracle implementation. +2. Does the network require custom request factory, registry, or deployer. +3. Do mutables or immutables need chain-specific values. +4. Are external library links compatible with this chain. + +### Typical override strategy + +1. Keep default mapping stable. +2. Apply ecosystem-level override when many chains share runtime constraints. +3. Apply chain-level override only for strict exceptions. + +## 3. Upgrade Existing Supported Network + +## 3.1 Preconditions + +```bash +pnpm run fmt +pnpm run compile +``` + +## 3.2 Selective upgrade + +Use your internal release workflow to upgrade only the targeted artifacts. + +## 3.3 Full upgrade path + +Use your approved full-upgrade process only when a selective upgrade is not sufficient. + +## 3.4 Validation + +```bash +npx witeth gateway +npx witeth framework --verbose +``` + +## 4. Add A New Network And Deploy + +1. Add network metadata to your supported-network catalog. +2. Add implementation mapping overrides if needed. +3. Add deployment specs. +4. Deploy with your approved automation. +5. Validate framework state from CLI. + +## 5. Operations Runbook + +- Health checks: framework, priceFeeds, queries, randomness, reports. +- Credential hygiene: isolated signer keys per environment. +- Incident handling: capture tx hash, block, and failing artifact version before retries. diff --git a/docs/solidity-guide.md b/docs/solidity-guide.md new file mode 100644 index 00000000..1eff59b6 --- /dev/null +++ b/docs/solidity-guide.md @@ -0,0 +1,282 @@ +# Solidity Developer Guide + +This guide covers integration patterns for Price Feeds, Randomness, and custom Radon-based requests. + +## 1. Price Feeds + +## 1.1 List supported price feeds + +You can enumerate supported feeds both from Solidity and from CLI. + +Solidity path: + +- Call `IWitPriceFeeds.lookupPriceFeeds()`. +- Return value is `PriceFeedInfo[]`, where each item includes: +- `id`, `exponent`, `symbol`, `mapper`, `oracle`, `updateConditions`, `lastUpdate`. + +CLI path: + +- Run `npx witeth priceFeeds`. +- CLI table highlights: +- `ID4`: 4-byte feed id. +- `CAPTION`: feed caption. +- `FRESHNESS`: relative age of latest update. +- `DATA PROVIDERS`: source providers or mapped dependencies. + +## 1.2 Consume subsidized feeds + +Use WitPriceFeeds to consume subsidized feeds through four compatible read paths. + +### Witnet-native way (`IWitPriceFeeds`) + +Methods: + +- `getPrice(ID4 id4)` +- `getPriceNotOlderThan(ID4 id4, uint24 age)` +- `getPriceUnsafe(ID4 id4)` + +Arguments: + +- `id4`: 4-byte feed identifier. +- `age`: max allowed staleness in seconds. + +Reverts: + +- `PriceFeedNotFound()`. +- `StalePrice()` for stale values in sanity-checked methods. +- `InvalidGovernanceTarget()` for invalid EMA/governance setup. + +Returns: + +- `Price` struct: `exponent`, `price`, `deltaPrice`, `timestamp`, `trail`. + +### ERC-2362 way (`valueFor(bytes32)`) + +Method: + +- `valueFor(bytes32 id)` + +Arguments: + +- `id`: 32-byte feed id. + +Reverts: + +- Usually status-driven rather than revert-driven for stale/missing values. + +Returns: + +- `(int256 value, uint256 timestamp, uint256 status)` where current implementation uses: +- `200` fresh, `400` stale, `404` not found. + +### Pyth-adapted way (`IWitPyth`) + +Methods: + +- `getPrice(bytes32 id)` +- `getPriceNotOlderThan(bytes32 id, uint64 age)` +- `getPriceUnsafe(bytes32 id)` +- `getEmaPrice(bytes32 id)` +- `getEmaPriceNotOlderThan(bytes32 id, uint64 age)` +- `getEmaPriceUnsafe(bytes32 id)` + +Arguments: + +- `id`: `bytes32` price id. +- `age`: max accepted staleness in seconds. + +Reverts: + +- `PriceFeedNotFound()`. +- `StalePrice()` in sanity-checked methods. +- `InvalidGovernanceTarget()` for EMA/governance incompatibilities. + +Returns: + +- `PythPrice`: `price`, `conf`, `expo`, `publishTime`. + +### Chainlink-adapted way (`IWitPythChainlinkAggregator`) + +Flow: + +1. Create adapter with `IWitPriceFeeds.createChainlinkAggregator(string caption)`. +2. Read through Chainlink-compatible methods on returned adapter. + +Methods: + +- `latestRoundData()` +- `getRoundData(uint80 roundId)` +- `decimals()`, `description()`, `version()` +- `id4()`, `priceId()`, `symbol()`, `witOracle()` + +Arguments: + +- `caption`: feed caption when creating adapter. +- `roundId`: round id for historical reads. + +Reverts: + +- Adapter creation reverts if caption is unsupported. +- Read calls may bubble up underlying feed lookup failures. + +Returns: + +- Chainlink tuple `(roundId, answer, startedAt, updatedAt, answeredInRound)`. + +### Compact Solidity example (all 4 paths) + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import { IWitPriceFeeds, IWitPriceFeedsTypes } from "@witnet/solidity/contracts/interfaces/IWitPriceFeeds.sol"; +import { IWitPyth } from "@witnet/solidity/contracts/interfaces/legacy/IWitPyth.sol"; +import { IWitPythChainlinkAggregator } from "@witnet/solidity/contracts/interfaces/legacy/IWitPythChainlinkAggregator.sol"; + +interface IERC2362 { + function valueFor(bytes32 id) external view returns (int256 value, uint256 timestamp, uint256 status); +} + +contract FeedReadExamples { + IWitPriceFeeds public immutable feeds; + + constructor(address feedsAddress) { + feeds = IWitPriceFeeds(feedsAddress); + } + + // 1) Witnet-native + function readNative(bytes4 id4) + external + view + returns (IWitPriceFeedsTypes.Price memory checked, IWitPriceFeedsTypes.Price memory unsafe_) + { + checked = feeds.getPrice(IWitPriceFeedsTypes.ID4.wrap(id4)); + unsafe_ = feeds.getPriceUnsafe(IWitPriceFeedsTypes.ID4.wrap(id4)); + } + + // 2) ERC-2362 compatibility + function readErc2362(bytes32 id32) external view returns (int256 value, uint256 timestamp, uint256 status) { + return IERC2362(address(feeds)).valueFor(id32); + } + + // 3) Pyth-adapted compatibility + function readPyth(bytes32 id32) + external + view + returns (IWitPyth.PythPrice memory spot, IWitPyth.PythPrice memory ema) + { + IWitPyth.ID id = IWitPyth.ID.wrap(id32); + spot = feeds.getPriceNotOlderThan(id, 300); + ema = feeds.getEmaPriceUnsafe(id); + } + + // 4) Chainlink-adapted compatibility + function createAndReadChainlink(string calldata caption) + external + returns (address aggregator, int256 answer, uint256 updatedAt) + { + aggregator = feeds.createChainlinkAggregator(caption); + (, answer, , updatedAt, ) = IWitPythChainlinkAggregator(aggregator).latestRoundData(); + } +} +``` + +### Production pattern: read from pre-created Chainlink adapter + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +import { IWitPythChainlinkAggregator } from "@witnet/solidity/contracts/interfaces/legacy/IWitPythChainlinkAggregator.sol"; + +contract FeedReadChainlinkOnly { + IWitPythChainlinkAggregator public immutable adapter; + + constructor(address adapterAddress) { + adapter = IWitPythChainlinkAggregator(adapterAddress); + } + + function readLatest() + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) + { + return adapter.latestRoundData(); + } + + function metadata() + external + view + returns (bytes4 id4, bytes32 priceId, string memory symbol, address witOracle, uint8 decimals) + { + return (adapter.id4(), adapter.priceId(), adapter.symbol(), adapter.witOracle(), adapter.decimals()); + } +} +``` + +## 1.3 Get your contracts reported when a new price update is available + +See the @witnet/price-feeds README: + +- https://github.com/witnet/price-feeds/blob/master/README.md + +## 1.4 Permissionless reporting workflow + +See the @witnet/price-feeds README: + +- https://github.com/witnet/price-feeds/blob/master/README.md + +## 1.5 Introspect sources and history via CLI + +See the @witnet/price-feeds README: + +- https://github.com/witnet/price-feeds/blob/master/README.md + +## 2. Randomness + +## 2.1 Pull from contracts + +Use WitRandomness randomize flow from your contract and consume finalized randomness once available. + +## 2.2 Pull from off-chain + +```bash +npx witeth randomness --target --randomize --signer +npx randomizer --target +``` + +## 2.3 Callback consumer pattern + +1. Clone WitRandomness. +2. Trigger randomize from bot or transactions. +3. Implement IWitRandomnessConsumer callback entrypoint. + +```bash +npx witeth randomness --target --clone --signer +``` + +## 3. Custom Feeds (Radon Requests) + +## 3.1 Radon Request model + +A Radon Request defines data retrieval, transformation, aggregation, and commit/reveal parameters. + +## 3.2 Build invariable and parameterized requests + +- Solidity: framework artifacts and contracts. +- JavaScript: @witnet/sdk asset composition. + +## 3.3 Dry-run and verification + +```bash +npx witeth assets --all --decode +npx witeth assets --dry-run +npx witeth assets --deploy +``` + +## 3.4 Pull by RAD hash and validate pushed updates + +```bash +npx witeth queries --filter-radHash +npx witeth reports --filter-radHash --parse +``` From 692af9cafd9965ab83d170d7ab03ad2e93148c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Thu, 19 Mar 2026 14:41:00 +0100 Subject: [PATCH 4/5] chore: pnpm update --- pnpm-lock.yaml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c63e6c5b..6201afcd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -748,10 +748,6 @@ packages: resolution: {integrity: sha512-vnI7V6lFNe0tLAuJMu+2sX+FcL14TaCWy1qiczg1VwRmPrpQCdq5ESXQMqUc2tluRNf6irBXrWbl1mGN8uaU/g==} engines: {node: ^14.21.3 || >=16} - '@noble/curves@1.9.7': - resolution: {integrity: sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==} - engines: {node: ^14.21.3 || >=16} - '@noble/hashes@1.2.0': resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} @@ -4642,8 +4638,8 @@ packages: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true - valibot@1.2.0: - resolution: {integrity: sha512-mm1rxUsmOxzrwnX5arGS+U4T25RdvpPjPN4yR0u9pUBov9+zGVtO84tif1eY4r6zWxVxu3KzIyknJy3rxfRZZg==} + valibot@1.3.0: + resolution: {integrity: sha512-SItIaOFnWYho/AcRU5gOtyfkTsuDTC3tRv+jy4/py8xERPnvHdM+ybD1iIqWTATVWG1nZetOfwZKq5upBjSqzw==} peerDependencies: typescript: '>=5' peerDependenciesMeta: @@ -5212,7 +5208,7 @@ snapshots: '@bitcoinerlab/secp256k1@1.2.0': dependencies: - '@noble/curves': 1.9.7 + '@noble/curves': 1.8.2 '@colors/colors@1.6.0': {} @@ -5639,7 +5635,7 @@ snapshots: '@graphql-tools/utils': 8.9.0(graphql@15.10.1) dataloader: 2.1.0 graphql: 15.10.1 - tslib: 2.4.1 + tslib: 2.8.1 value-or-promise: 1.0.11 optional: true @@ -5859,10 +5855,6 @@ snapshots: dependencies: '@noble/hashes': 1.7.2 - '@noble/curves@1.9.7': - dependencies: - '@noble/hashes': 1.8.0 - '@noble/hashes@1.2.0': {} '@noble/hashes@1.3.2': {} @@ -6980,7 +6972,7 @@ snapshots: '@noble/hashes': 1.8.0 '@scure/base': 1.2.6 uint8array-tools: 0.0.8 - valibot: 1.2.0(typescript@5.9.3) + valibot: 1.3.0(typescript@5.9.3) wif: 5.0.0 transitivePeerDependencies: - typescript @@ -7686,7 +7678,7 @@ snapshots: dependencies: bn.js: 4.12.3 brorand: 1.1.0 - hash.js: 1.1.3 + hash.js: 1.1.7 hmac-drbg: 1.0.1 inherits: 2.0.4 minimalistic-assert: 1.0.1 @@ -10728,7 +10720,7 @@ snapshots: uuid@9.0.1: {} - valibot@1.2.0(typescript@5.9.3): + valibot@1.3.0(typescript@5.9.3): optionalDependencies: typescript: 5.9.3 From 3de82c7d201abfdf06ae2e1a2c97a38ab1819ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Thu, 19 Mar 2026 14:49:54 +0100 Subject: [PATCH 5/5] chore: bump package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b01e1328..be9fc794 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@witnet/solidity", - "version": "3.2.2", + "version": "3.2.3", "description": "Wit/Oracle Solidity Framework for EVM-compatible chains", "author": "Witnet Foundation ", "license": "MIT",