develop-testnet.xoracle.io Open in urlscan Pro
188.114.97.3  Public Scan

URL: https://develop-testnet.xoracle.io/
Submission: On July 21 via api from US — Scanned from NL

Form analysis 0 forms found in the DOM

Text Content

 * Message
 * Price Feeds
 * Data Feeds
 * Docs

--------------------------------------------------------------------------------

 * Message
 * Price Feeds
 * Data Feeds
 * Docs




DISCOVER A SECURE AND
LIGHTWEIGHT SOLUTION.

Build DeFi apps with seamless cross-chain communication and
rapid fast price feed.
Get Stared

47+
Messages
304+
Request Prices
4
Networks


EXPLORE TOP CRYPTO PRICE LIKE BITCOIN,
ETHEREUM, AND MORE

Simply and securely buy, sell, and manage hundreds of cryptocurrencies.

BTC / USD
$
67,185.9
0.04
%
ETH / USD
$
3,477.67
-0.91
%
BNB / USD
$
595.43
0.15
%
USDT / USD
$
0.9957
-0.07
%
USDC / USD
$
0.9970
-0.07
%
SOL / USD
$
177.02
2.71
%


SIMPLE TO ACCESS
ACCURATE PRICES RAPIDLY.

Easily request prices by interact with xOracle's price feed contracts instantly
using 'requestPrices'

ArchitectureCode
1// 1. send request prices to xOracle contract 2function requestPrices()
external { 3 // allowance req fee 4 IERC20(weth).approve(xOracle,
type(uint256).max); 5 6 bytes memory payload = ""; // no payload 7 uint256
expired = 0; // no expiration 8 uint256 maxGasPrice = 10e9; // 10 gwei 9 uint256
callbackMaxGasLimit = 5000000; // 5M 10 11
IXOracle(xOracle).requestPrices(payload, expired, maxGasPrice,
callbackMaxGasLimit); 12} 13 14// 2. callback from xOracle fulfill prices
15function xOracleCall(uint256 _reqId, bool _priceUpdate, bytes memory _payload)
external onlyXOracle { 16 // get all latest prices 17 (, uint256 btcPrice, , ) =
IXOracle(xOracle).getLastPrice(0); // BTC 18 (, uint256 ethPrice, , ) =
IXOracle(xOracle).getLastPrice(1); // ETH 19 (, uint256 bnbPrice, , ) =
IXOracle(xOracle).getLastPrice(2); // BNB 20 (, uint256 usdtPrice, , ) =
IXOracle(xOracle).getLastPrice(3); // USDT 21 ... 22}
source_chain.soldestination_chain.sol
1// # source chain 2// send message to endpoint contract address on the
destination chain 3function send(address _token, uint256 _amount, uint64
_dstChainId, uint256 _dstTokenIndex, address _receiver) external payable { 4 //
get fee 5 uint256 fee = IXOracleMessage(xOracleMessage).getFee(_dstChainId); 6
require(msg.value >= fee, "insufficient fee"); 7 8 ... 9 10 // send message 11
bytes memory payload = abi.encode(uid, srcTokenIndex, _dstTokenIndex, _amount,
chainId, _dstChainId, msg.sender, _receiver); 12
IXOracleMessage(xOracleMessage).sendMessage{ value: msg.value }(payload,
endpointAddress, _dstChainId); 13}


SEND MESSAGE ACROSS CHAINS.

Effortlessly teransmit messages across chains with seamless integration.

Experience the fluidity of cross-chain communication facilitated by xOracle.

ArchitectureCode


EXPLORE DEFI APPS USING XORACLE

Visit the powerful DeFi applications empowered by the trusted data provided by
xOracle.

TFX

Decentralized Perpetual Exchange, Trade BTC, ETH, BNB and other top
cryptocurrencies with up to 50x leverage directly from your wallet

Powered by Crown Labs
©2024 xOracle Explorer