![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@opiumteam/opium-sdk-v2
Advanced tools
one-stop-shop SDK to interact with the Opium-v2 protocol contracts, subgraphs and APIs
The OpiumV2SDK
class is the entry-point to all the core functionality of the SDK.
The SDK is divided in 4 main services:
It includes class wrappers to facilitate the interaction with the Opium V2 core contract, respectively Registry, Core, SyntheticAggregator, OracleAggregator. The address of the contracts will be automatically initialized according to the chainId
with which the SDK class had been initialized.
It allows to easily query the Opium V2 subgraph according to the chainId
with which the SDK class had been initialized.
It allows to perform some useful queries about the protocol parameters - i.e.: calculate the derivative hash for a given derivative, calculate the LONG/SHORT positions addresses for a given derivative etc. - either locally via ethers.js
or by calling a helper contract.
It allows to query the state of user-defined contracts running on the Opium V2 protocol - i.e: oracleIds and syntheticIds.
yarn add @opiumteam/opium-sdk-v2
You can easily initialize the OpiumV2SDK
by passing a valid rpcUrl and its associated chainId, as in the following code snippet:
const main = async () => {
const sdk = new OpiumV2SDK({
rpcUrl: 'https://rinkeby.arbitrum.io/rpc',
chainId: 421611,
});
const { registryInstance, subgraphService, simulatorService, derivativeLensFactory } = sdk;
const { coreInstance, oracleAggregatorInstance, syntheticAggregatorInstance } = await sdk.setup();
};
OpiumV2SDK
, the registryInstance, subgraphService, simulatorService, derivativeLensFactory will be instantiated.setup
function: this is because the addresses used for the initialization of the core wrapped contracts are fetched directly from the Opium V2 Registry contract as to avoid forcing the users to pass them manually.JsonRpcProvider
provider by passing a web3.js provider in the override
field. Read more here.export interface IOpiumV2SDKConfig {
rpcUrl: string;
chainId: number;
override?: providers.ExternalProvider;
}
SimulatorService
class to calculate the LONG/SHORT positions addresses locally by using the ethers.utils.getCreate2Address
FAQs
one-stop-shop SDK to interact with the Opium-v2 protocol contracts, subgraphs and APIs
The npm package @opiumteam/opium-sdk-v2 receives a total of 7 weekly downloads. As such, @opiumteam/opium-sdk-v2 popularity was classified as not popular.
We found that @opiumteam/opium-sdk-v2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.