New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@infinex/infinex-sdk

Package Overview
Dependencies
Maintainers
0
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@infinex/infinex-sdk

The Infinex SDK provides a comprehensive toolkit for interacting with the Infinex multichain ecosystem. It supports a wide range of blockchain networks and allows for seamless integration with Infinex contracts. This README provides an overview of the SDK

  • 1.2.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Infinex SDK

The Infinex SDK provides a comprehensive toolkit for interacting with the Infinex multichain ecosystem. It supports a wide range of blockchain networks and allows for seamless integration with Infinex contracts. This README provides an overview of the SDK's capabilities, installation instructions, usage examples, and configuration options.

Installation

To install dependencies

pnpm i

To fetch the latest address from cannon

pnpm run fetch:addresses

To process abis from /out

pnpm run sdk:build

Overview

.env.*

  • For now we have mapped enviroments to our deployed enviroments. Which are:
    • dev
    • test
    • staging
    • prod
  • Each enviroment will hold the addresses for the deployed contracts.
/chains
  • A list of chains that are configured with a set of enviroment variables. These will eventually be in side the deployments repo and injected in. At the moment you will need to have all the .env vars pnpm run fetch:address will give you all the evm address needed to start.

  • Chains are configured with most of the default contracts and account you will need per chain. Theres no ambguity about which address are needed and which are not.

  • As the contracts are worked on the sdk will add the necessary address to keep up to date with the interfaces and contracts

/contracts
  • The contracts folder are a list of preconfigured viem contracts https://viem.sh/docs/contract/getContract

  • These contracts can take in the chain configuration, and also are overridable.

/utils
  • Utility functions to help testing and running functions against the contracts.

    • initEvmChains()
    • selectChains(['arbitrum'])
    • createForwardRequest({ from, to, data, signer })
Adding contracts

To add new contracts, follow these steps:

  1. Add the contract to the .env.*.template if theres multiple contracts please update each enviroment.
    1. Prefix the ADDRESS with the chain its on ie: base = BASE
  2. Add the contract in the contracts folder. Copy an exsisting contract in that folder.
  3. Add that contract name prefixed with the chain to the /env types and to /schema to catch missing contract addresses.
  4. Add the /out contract name for example AccountFactory to the the config contract list.
  5. Run the pnpm run build build to copy and format the abi
Building the addresses

Under the hood we currently use cannon to do deployments and we deploy, local / testnet / mainnet / forked-mainnet each env will have different addresses therefore we need to build and fetch the addresses for any enviroment.

The addresses are stored in a cache if not published to usecannon.com. In order to fetch the addresses, we want we should update the src code as followed:

./scripts/getPublishedContracts */

pnpm run fetch:addresses --package-scope="infinex-multichain" --package-version="latest" --include-chains="arbitrum, ethereum, base"

Fetching all chains

pnpm run fetch:addresses --package-scope="infinex-multichain" --package-version="latest"

All the addrsses will be here

./deployments/addresse.txt

# Scope: infinex-multichain

## Version: latest

### Chain: arbitrum-sepolia

ARBITRUM_FORWARDER_ADDRESS='0x5c593fdE5a2C8d9C6A2C7785490dd879E01e1a74'
ARBITRUM_ACCOUNT_FACTORY_ADDRESS='0x628cF9F21731E56E63768Ce993cBAF70A7C52cA4'
ARBITRUM_INFINEX_PROTOCOL_CONFIG_BEACON_ADDRESS='0x2b8587b08bB3DB1fA969792A255b2dC6385266A9'

FAQs

Package last updated on 01 Aug 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc