npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

myria-core-sdk-staging

v0.0.1

Published

Latest version SDK

Readme

Myria-Core-SDK

Myria core SDK to implement all of transaction and workflow for FE integration

Setup and installation

Git:

git clone [email protected]:myriaworld/myrianet/blockchain/myria-core-sdk.git

Using npm:

npm install

Using yarn:

yarn install

Environment

SDK is integrated with core-service at stable environment(dev, staging) on core. We can also checkout the core-service to make and debugging the integration locally in terms of testing.

Structure Codebase

.
├── __tests__
│   ├── MyriaClient.ts
│   │
├── config
│   └── fileTransformer.js
│   └── tsconfig.cjs.json
│   └── tsconfig.esm.json
│   └── tsconfig.types.json
│   └── tsconfig.umd.json
│   └── webpack.config.js
│   │
├── dist (build folder)
│   │
├── src
│   ├── clients
│   │   ├── MyriaClient.ts
│   │
├── ├── contracts (abi)
│   │   └── Deposits.json
│   │   └── TokensAndRamping.json
│   │   └── Withdrawals.json
│   │
│   ├── core
│   │   ├── apis
│   │   │   └── Deposits.json
│   │   └── axios
│   │   │   └── error.ts
│   │   │   └── index.ts
│   │   │   └── request-helpers.ts
│   │   │
│   │   └── Contract.ts
│   │   └── ContractFactory.ts
│   │   └── ContractHelpers.ts
│   │   └── DepositContract.ts
│   │   └── WithdrawalContract.ts
│   │
│   ├── modules
│   │   └── DepositModule.ts
│   │   └── WithdrawModule.ts
│   │   └── ModuleFactory.ts
│   │   └── index.ts
│   │
│   ├── types
│   │   └── CommonTypes.ts
│   │   └── ContractTypes.ts
│   │   └── index.ts
├── tools
│   └── cleanup.ts
...

Usage and Example

Deposit ETH transaction for both onchain and offchain:


    const initializeClient: IMyriaClient = {
      provider: web3Instance.currentProvider,
      networkId: 5,
      web3: web3Instance
    };

    const moduleFactory = new Modules.ModuleFactory(initializeClient);
    const depositModule = moduleFactory.getDepositModule();


    const amount = Web3.utils.toWei("0.00001");
    const result = await depositModule.depositEth(
      {
        starkKey: '0x' + starkPublicKey,
        tokenType: TokenType.ETH,
        amount
      },
      {
        confirmationType: Types.ConfirmationType.Sender,
        from: accounts[0], 
        value: amount,
      }
    );

Deposit ERC20 tokens to Myria L2 Wallets


    const initializeClient: IMyriaClient = {
      provider: web3Instance.currentProvider,
      networkId: 5,
      web3: web3Instance
    };

    const moduleFactory = new Modules.ModuleFactory(initializeClient);
    const depositModule = moduleFactory.getDepositModule();
    const quantizedAmount = '11';

    const result = await depositModule.depositERC20Token(
      {
        starkKey: '0x' + starkPublicKey,
        tokenAddress: '0x1b335FD6c49b360D8A7104FCc6c26C28111fC3FC',
        tokenType: TokenType.ERC20,
        quantizedAmount: quantizedAmount,
      },
      {
        from: accounts[0],
      }
    );

In case for another third-party want to call directly with onchain transaction ,we can use the contract instance.

Deposit Eth:

    const myriaClient: IMyriaClient = {
      provider: web3Instance.currentProvider,
      networkId: 5, // GOERLI NETWORK/ OTHERS/ MAINNET
      web3: web3Instance
    };
    const contractFactory = new ContractFactory(myriaClient);
    const depositContract = contractFactory.getDepositContract();

    const vaultId = '1';

    const result = await depositContract.depositEth(
      '0x' + starkPublicKey,
      assetType,
      vaultId,
      {
        from: accounts[0], 
      }
    );

Deposit ERC20 Token:

const assetType = asset.getAssetType({
      type: 'ERC20',
      data: {
        quantum: '1',
        tokenAddress: '0x0eD03E6917543a45af099909f07bC5b4C69E868A',
      }
    });

    const initializeClient: IMyriaClient = {
      provider: web3Instance.currentProvider,
      networkId: 5,
      web3: web3Instance
    };

    const myriaClient = new MyriaClient(initializeClient);
    const contractFactory = new ContractFactory(myriaClient);
    const depositContract = contractFactory.getDepositContract();

    const vaultID = '2';

    const result = await depositContract.depositERC20(
      '0x' + starkPublicKey,
      assetType,
      vaultID,
      '1',
      {
        from: accounts[0], 
      }
    );

Withdraw and mint:

      const assetType = asset.getAssetType({
      type: 'MINTABLE_ERC721',
      data: {
        quantum: '1',
        tokenAddress: '0xD5f1cC0264d0E22BE4488109dbf5d097eb37a576',
      }
    });
  
    const initializeClient: IMyriaClient = {
      provider: web3Instance.currentProvider,
      networkId: 5,
      web3: web3Instance
    };

    const moduleFactory = new Modules.ModuleFactory(initializeClient);
    const withdrawModule = moduleFactory.getWithdrawModule();

    const result = await withdrawModule.withdrawAndMint(
      {
        starkKey: '0x' + starkPublicKey,
        tokenType: TokenType.MINTABLE_ERC721,
        tokenAddress: '0xD5f1cC0264d0E22BE4488109dbf5d097eb37a576',
        assetType: assetType,
        mintingBlob: ''
      },
      {
        confirmationType: Types.ConfirmationType.Sender,
        nonce: '1',
        from: accounts[0]
      }
    );

Withdraw offchain:

    const assetType = asset.getAssetType({
      type: 'ETH',
      data: {
        quantum: '1',
      }
    });

    const amount = Web3.utils.toWei("0.00001");
  
    const initializeClient: IMyriaClient = {
      provider: web3Instance.currentProvider,
      networkId: 5,
      web3: web3Instance
    };

    const moduleFactory = new Modules.ModuleFactory(initializeClient);
    const withdrawModule = moduleFactory.getWithdrawModule();

    const result = await withdrawModule.withdrawalOffchain(
      {
        starkKey: '0x' + starkPublicKey,
        tokenType: TokenType.ETH,
        amount,
        tokenAddress: '',
        vaultId: undefined,
        assetId: assetType,
        tokenId: '',
      },
      {
        from: accounts[0],
        nonce: '1',
        confirmationType: Types.ConfirmationType.Sender,
      }
    );

Build command

Global build:

  yarn build

Build CJS:

  yarn build:cjs

Build ESM:

  yarn build:cjs

Build UMD:

  yarn build:umd

Build UMD:

  yarn build:umd

Build Types:

  yarn build:types

Package module

Package modules:

  yarn package

Lint & Test

Run test:

  yarn test 

Run test with coverage:

  yarn test:cov 

Publish to NPM

Publish to NPM

  yarn publish

License

Myria Core Team

Project status

On development