
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@finalitee-labs/udf-sdk
Advanced tools
You can install the package using npm:
npm install @finalitee-labslabs/udf-sdk
Or using yarn:
yarn add @finalitee-labs/udf-sdk
import { UdfSdk } from '@finalitee-labs/udf-sdk';
// Initialize SDK
const sdk = new UdfSdk();
// Get latest price data
async function getEthPrice() {
// Get median price
const median = await sdk.getMedian('ETH/USD');
console.log('ETH/USD Median Price:', median);
// Get all votes
const votes = await sdk.getVotes(['ETH/USD']);
console.log('All votes:', votes);
// Get update call data
const callData = await sdk.getCallData(['ETH/USD']);
console.log('Update call data:', callData);
}
constructor(baseUrl?: string)
Creates a new instance of UdfSdk.
baseUrl (optional): Base URL for the UDF API. Defaults to 'https://udfsnap.ent-dx.com/'Gets the median price for a specific feed.
feedKey: The feed identifier (e.g., 'ETH/USD')const median = await sdk.getMedian('ETH/USD');
Gets all votes for specified feeds.
feedKeys: Array of feed identifiersconst votes = await sdk.getVotes(['ETH/USD', 'BTC/USD']);
Gets the update call data for specified feeds.
feedKeys: Array of feed identifiersconst callData = await sdk.getCallData(['ETH/USD']);
async function getMultipleFeeds() {
const sdk = new UdfSdk();
const feeds = ['ETH/USD', 'BTC/USD'];
// Get all feed data
const votes = await sdk.getVotes(feeds);
// Process votes
for (const vote of votes) {
console.log(`${vote.feedKey}: ${vote.value} (from ${vote.publisher})`);
}
}
const sdk = new UdfSdk('https://your-custom-url.com');
The SDK throws errors in the following cases:
try {
await sdk.getVotes(['ETH/USD']);
} catch (error) {
if (error.message.includes('HTTP error')) {
console.error('Network error:', error);
}
}
try {
const median = await sdk.getMedian('ETH/USD');
} catch (error) {
if (error.message.includes('No votes provided')) {
console.error('No data available:', error);
}
}
FAQs
SDK for interacting with UDF Oracle
We found that @finalitee-labs/udf-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.