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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@arun89-crypto/hypersdk

v1.1.0

Published

Hyper Bridge Project: Seamlessly links Base & Optimism blockchains via Layer Zero Router. Swap native & wrapped tokens effortlessly. Empowers devs with user-friendly SDK for cross-chain interaction. Unlocking DeFi potential & blockchain adoption.

Downloads

15

Readme

HyperSDK 🌀

Hyper Bridge Project: Seamlessly links Base & Optimism blockchains via Layer Zero Router. Swap native & wrapped tokens effortlessly. Empowers devs with user-friendly SDK for cross-chain interaction. Unlocking DeFi potential & blockchain adoption.

[NATIVE TO WRAPPED NATIVE SWAPPER]

Cross Chain Swap Time : 10 sec to 1 min

Simple to use

import { HyperSwapper } from '@arun89-crypto/hypersdk';
import { ethers } from 'ethers';

const main = async () => {
  // Declaring the providers
  const provider1 = new ethers.JsonRpcProvider(RPC_OPT);
  const provider2 = new ethers.JsonRpcProvider(RPC_BASE);

  // Declaring the signers
  const signer1 = new ethers.Wallet(P_KEY, provider1);
  const signer2 = new ethers.Wallet(P_KEY, provider2);

  // Initiating the swapper
  const swapper = new HyperSwapper({
    rpc_url_1: RPC_OPT, // RPC URL : chain 1
    rpc_url_2: RPC_BASE, // RPC URL : chain 2
    name_1: 'OPTIMISM', // Chain 1 Name
    name_2: 'BASE', // Chain 2 Name
    signer1: signer1, // Signer : chain 1
    signer2: signer2, // Signer : chain 2
  });

  // Swapping from Optimism -> Base
  const swap = await swapper.Swap1to2('0.0001');

  console.log(swap);
  /*
  Returns :

  interface SwapResult {
    result: TransactionResult;
    TransactionHash?: string;
    TransactionData?: string;
  }

  enum TransactionResult {
    ACCEPTED,
    REJECTED,
  }
  */
};

Supported Chains (Testnet)

  • Optimism Göerli
  • Base Göerli
  • Polygon Mumbai (Coming soon .....)
  • Ethereum Göerli (Coming soon .....)

Tech Stack

  • Typescript
  • Solidity
  • EthersJS
  • Layer Zero
  • UniswapV3

How to install ?

npm i @arun89-crypto/hypersdk
--
yarn add @arun89-crypto/hypersdk

Config

| Param | Optional | Description | | :-------- | :------- | :------------------------ | | rpc_url_1 | true | RPC URL for chain 1 | | rpc_url_2 | true | RPC URL for chain 2 | | name_1 | true | Name of chain 1 | | name_2 | true | Name of chain 2 | | signer_1 | true | Ethers Signer for chain 1 | | signer_2 | true | Ethers Signer for chain 2 |

Functions

| Name | Params | Description | | :------------------------------------ | :------------------------------ | :------------------------------------------------------- | | Swap1to2 | _amount:string Eg : "0.001" | Swap assets from chain 1 to chain 2 | | Swap2to1 | _amount:string Eg : "0.001" | Swap assets from chain 2 to chain 1 | | _estimateFeeFrom1to2 | | Return the estimated relayer fee from chain 1 to chain 2 | | _estimateFeeFrom2to1 | | Return the estimated relayer fee from chain 2 to chain 1 | | _getTransactionStatusLZ_1 | txn_hash:string | Return the transaction status for chain 1 | | _getTransactionStatusLZ_2 | txn_hash:string | Return the transaction status for chain 2 | | _getFullTransactionStatusLZ_1 | txn_hash:string | Return the full transaction status for chain 1 | | _getFullTransactionStatusLZ_2 | txn_hash:string | Return the full transaction status for chain 2 | | getNativeWrappedTokenAddressChain1 | | Return the tWETH address for chain 1 | | getNativeWrappedTokenAddressChain2 | | Return the tWETH address for chain 2 | | getNativeWrappedTokenBalanceContract1 | | Return the tWETH balance for chain 1 contract | | getNativeWrappedTokenBalanceContract2 | | Return the tWETH balance for chain 2 contract |