Getting Started
Last updated
Was this helpful?
Last updated
Was this helpful?
The Witnet SDK offers a comprehensive range of NPM packages tailored to various Web3 environments and programming languages, ensuring you have the right tools for your specific use case.
Javascript and Typescript developers willing to interact with the Witnet blockchain.
Developers willing to report notarized oracle queries from the Witnet blockchain into smart contracts in EVM-compatible chains, get smart contracts to build verifiable oracle queries on-chain, or pull them off from the Witnet blockchain. Embeds @witnet/sdk.
Devops and devs willing to leverage, query or autonomously report notarized price feed updates, subsidized or not by the Witnet Foundation. Embeds: @witnet/sdk and @witnet/sdk-solidity.
You don't need to run a Witnet node, stake $WIT coins, or pay subscription fees to use any of these packages, whatsoever. The Witnet SDK is totally open sourced and distributed under MIT license.
Node.js >=18.17.0
This package embeds an executable that allows you to interact with the Witnet blockchain and even manage your own $WIT coins and Radon assets (i.e. customized oracle queries and web data sources), from the command line. It also allows dry-running oracle data queries, locally.
Two environment variables are required to interact with the Witnet blockchain:
WITNET_SDK_PROVIDER_URL
WITNET_SDK_WALLET_MASTER_KEY
URL of the Wit/RPC endpoint that will provide both information about the Witnet network, and the transmission of transactions signed in Javascript.
This URL can correspond to that of any validator or archive nodes in the Witnet network (as long as the corresponding http/rpc port is reachable), or any of the public-domain endpoints provided by the Witnet Foundation:
Witnet Mainnet
https://rpc.witnet.io
0x9FED
Where Wit/oracle queries get notarized for real, and results forever stored into the Witnet blockchain. Transactions get paid in real $WIT coins.
Witnet Testnet
https://rpc-testnet.witnet.io
0x2845
Only for testing purposes. Transactions get paid in $TWIT coins with no market value.
If no otherwise specified, and no WITNET_RPC_PROVIDER is set in the environment, classes from the Javascript library will rely on https://rpc.witnet.io as default Wit/RPC provider.
Verify the actual Witnet provider and network you're connecting to.
$ npx witnet network provider
The Wit/RPC provider should be operational and synced.
$ npx witnet network syncStatus
You should be able to operate with the same Witnet address/es as the one/s available on whatever app, or node, where the master key was imported from.
$ npx witnet wallet accounts
If using the Witnet Public Testnet for testing out transactions or notarization of oracle queries, please join the and ask for getting airdropped with some $TWIT testing coins for free.
In order to derive Witnet accounts, compose and sign transactions in Javascript, a valid private key in XPRV format must be provided, either , or from the or the wallet applications.