Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@dcspark/milkomeda-js-sdk

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dcspark/milkomeda-js-sdk

Package consisting of constant values for each Milkomeda network.

latest
npmnpm
Version
0.5.3
Version published
Maintainers
4
Created
Source

Milkomeda Constants

This is a package that hosts static configurations of Milkomeda deployments. This is useful to avoid having each project integrating Milkomeda hard-coding static configurations.

Contents

Example of the exposed payload of one of the Milkomeda Networks (devnet)

{
    [NETWORK_NAME]: {
        isMainnet: false,
        name: NETWORK_NAME,
        mainchain: {
            protocol: ProtocolNames.cardanoProtocol,
            id: toChainId({
                networkId: registry.Testnet.NetworkId,
                networkMagic: registry.Testnet.NetworkMagic
            })
        },
        sidechain: { protocol: ProtocolNames.evmProtocol, id: 200101 },
        backendEndpoint: BackendEndpoints.devnet,
        protocolMagic: ProtocolMagic.devnet,
        timeIntervalForAddressMs: 86400000,
        sidechainContract: "0x000000000000000000000000000000000000BbBB"
    },
}
  • isMainnet - boolean informing if the specific network configuration is mainnet or not,
  • mainchain - consists of mainchain information such as protocol and its id,
  • sidechain - consists of sidechain information such as protocol name and sidechain id,
  • backendEndpoint - provides url value for the service, which exposes additional information about specific version of the sidechain,
  • protocolMagic - introduces protocol magic compatible with appropriate Milkomeda network,
  • timeIntervalForAddressMs - time interval of a possible address change defined in miliseconds,
  • sidechainContract - address of the sidechain contract to which client can connect to

Additionally, the package introduces helper types & function which returns a JSON object.

# Milkomeda metadata generator
generateMilkomedaMetadata(
    address, # address is EVM address
    protocolMagic # protocol magic for specific network
)

Metadata of a transaction consists of two parameters - protocol magic & evm address. Exemplary metadata for testnet transaction is as follows:

{
    87: "devnet.cardano-evm.c1"
    88: "0xEVM_TESTNET_ADDRESS"
}

Keywords

Cardano

FAQs

Package last updated on 06 Sep 2022

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