Sign In

@entangle_protocol/oracle-sdk

Package Overview
Dependencies
Maintainers
4
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@entangle_protocol/oracle-sdk

The SDK for crosschain messaging

latest
Source
npmnpm
Version
1.5.22
Version published
Weekly downloads
91
355%
Maintainers
4
Weekly downloads
 
Created
Source

Photon Messaging Protocol

The SDK for crosschain messaging

Installing

yarn add "@entangle_protocol/oracle-sdk"

KYC

All externalDevelopers must contact us

Usage

import { ProtocolBuilder, ProtocolParams, TransmittersParams } from "@entangle_protocol/oracle-sdk";

async function setupProtocol() {

    const MANUAL_RECEIVERS = ["address1", "address2"];

    const transmittersParams: TransmittersParams = {
        maxTransmitters: 10,
        minDelegateAmount: ethers.utils.parseUnits("100", "ether"),
        minPersonalAmount: ethers.utils.parseUnits("10", "ether"),
    }
    const protocolParams: ProtocolParams = {
        msgBetAmount: ethers.utils.parseUnits("0.001", "ether"),
        dataBetAmount: ethers.utils.parseUnits("0.0001", "ether"),
        msgBetReward: ethers.utils.parseUnits("0.002", "ether"),
        dataBetReward: ethers.utils.parseUnits("0.0002", "ether"),
        msgBetFirstReward: ethers.utils.parseUnits("0.004", "ether"),
        dataBetFirstReward: ethers.utils.parseUnits("0.0004", "ether"),
        consensusTargetRate: CONSENSUS_TARGET_RATE
    };

    const builder = new ProtocolBuilder(
        PROTOCOL_ID,
        MANUAL_RECEIVERS,
        transmittersParams,
        protocolParams
    ).withSigner(
        externalDeveloper
    );

    const protocol: Protocol = await builder.build();

    console.log("Init protocol");

    await protocol.verifyOrCreate(await externalDeveloper.getAddress());

    await protocol.verifyOrCreate(await admin.getAddress());
    await protocol.addProtocolAddressEvm(CHAIN_ID, protocolContractAddress);
    await protocol.addProposerAddressEvm(CHAIN_ID, proposerContractAddress);

    await protocol.addExecutorEvm(CHAIN_ID, executorAddress);

    // deposit distrib amount to start protocol working
    await protocol.deposit(AMOUNT);
}

FAQs

Package last updated on 11 Feb 2025

Did you know?

Socket

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.

Install

Related posts