Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aarc-sdk

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aarc-sdk

The Aarc SDK is a TypeScript library that makes it easy for developers to transfer assets from Externally Owned Accounts (EOA) to any destination address. It simplifies the asset transfer process by supporting various token standards, such as ERC20 and ER

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
53
decreased by-44.79%
Maintainers
1
Weekly downloads
 
Created
Source

Aarc SDK

The Aarc SDK is a TypeScript library that makes it easy for developers to transfer assets from Externally Owned Accounts (EOA) to any destination address. It simplifies the asset transfer process by supporting various token standards, such as ERC20 and ERC721, and offering custom flows like batched transactions, gasless transactions, and paying gas fees with the same asset being moved. Additionally, it enables custom contract interaction within the same transaction using permit2(), allowing for direct swaps and bridge functionality.

Features of the SDK

  • Batch transactions on EoA with Uniswap’s Permit2 contract.
  • ERC20Permit support for streamlined token approvals.
  • Gasless transactions using Relayers (EIP2771).

Prerequisites

  • Node.js (v12.x or later)
  • Basic understanding of Ethereum and smart contracts.

Installation

Install ethers.js and Aarc SDK using npm:

npm install ethers@5.7.2 aarc-sdk

Getting Started

Get the API Key

To use Aarc SDK, an API key is required. Fill out this form to request the API key.

Initialise the SDK

Import and initialise the Aarc SDK in your project.

import { ethers } from "ethers";
import { AarcSDK } from aarc-sdk;

let aarcSDK = new AarcSDK.default({
  rpcUrl: rpcUrl,
  signer: signer, // the user's ethers.signer object
  apiKey: "YOUR_API_KEY",
});

await aarcSDK.init();

Usage

Fetching token balances

Retrieve balances of all tokens in an EOA wallet:

let balances = await aarcSDK.fetchBalances(
  tokenAddress: string[] // Optional: Array of specific token addresses
);

Moving Assets

Transfer tokens from EOA to any receiver wallet address:

await aarcSDK.executeMigration({
  receiverAddress:'RECEIVER_WALLET_ADDRESS',
  tokenAndAmount: // Optional. If not passed, the SDK will migrate all the tokens of the wallet
  [   
    {
      tokenAddress:TOKEN1_ADDRESS,
      amount:TOKEN1_AMOUNT // ethers.BigNumber
    },
    ...
  ]
})
// Returns the response given below

Output:

[
  {
    tokenAddress,
    amount,
    message,
    txHash,
    tokenId
  },
  ...
]

Moving Assets without gas

Transfer tokens from EOA to any receiver wallet address without gas fees. Please note that we use Gelato Relayer to provide the gasless functionality. Please get the Gelato API Key to use the gasless functionality.

await aarcSDK.executeMigration({
  receiverAddress:RECEIVER_WALLET_ADDRESS,
  tokenAndAmount: // Optional. If not passed, the SDK will migrate all the tokens of the wallet
  [   
    {
      tokenAddress:TOKEN1_ADDRESS,
      amount:TOKEN1_AMOUNT // ethers.BigNumber
    },
    ...
  ],
  GELATO_RELAYER_API_KEY // Use the link above to get the gelato relayer key
})
// Returns the response given below

Output:

[
  {
    tokenAddress,
    amount,
    message,
    txHash,
    tokenId
  },
  ...
]

Smart Wallet Integration

The Aarc SDK seamlessly integrates with different smart wallets. It currently supports Safe and Biconomy smart wallets and will add more options in the future.

Safe smart wallet

Fetching Existing Safes:

Retrieve a list of all Safe smart wallets associated with the user's EOA:

const safes = await aarcSDK.getAllSafes();
// This returns an array of Safe wallet addresses

Creating a New Safe Wallet:

Generate a new Safe smart wallet. The address returned is a counterfactual address, and the wallet needs to be deployed later. Asset migration can be directed to this address even before deployment.

const newSafeAddress = await aarcSDK.generateSafeSCW();
// Returns a counterfactual address for the new Safe wallet

Biconomy Smart Wallet

Creating a New Biconomy Wallet:

Similar to the Safe wallet, you can create a Biconomy smart wallet. The address provided is also a counterfactual address, requiring later deployment. The migration process can target this address immediately.

const newBiconomySCWAddress = await aarcSDK.generateBiconomySCW();
// Returns a counterfactual address for the new Biconomy wallet
More coming soon

License

This project is licensed under the MIT License - see the LICENSE for details.

Support and Feedback

For support or to share feedback, please schedule a meet here. You can also share your ideas and feedback on the community forum.

Keywords

FAQs

Package last updated on 13 Nov 2023

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