Introduction

What is Aarc?

Aarc’s Intent Execution Protocol is a destination-first solution that enables atomic cross-chain transactions through a single API. It simplifies complex cross-chain operations by abstracting away the complexities of bridging, swapping, and executing transactions across different networks.

Why use Aarc SDK?

The Aarc SDK simplifies interactions with the Intent Execution Protocol, enabling developers to:

Cross-Chain Transaction Management

Create and manage cross-chain transaction intents with ease, handling complex multi-chain operations seamlessly.

Atomic Transactions

Execute transactions with guaranteed outcomes, ensuring your NFT mints are either fully completed or safely reverted.

Real-time Monitoring

Monitor transaction progress and handle refunds efficiently with comprehensive status tracking and automated recovery.

Developer Friendly

Reduces developer efforts with simple integration and provides an intuitive user onboarding experience.

This reference provides a comprehensive guide to the SDK’s methods, utilities, and best practices for integration.

Setup

1

Install Dependencies

Install the package and other dependencies:

npm i @aarc-xyz/core
2

Import Package

Import the Aarc package in your code:

import { AarcCore } from "@aarc-xyz/core";
3

Get API Key

Get your API key from dashboard.aarc.xyz

4

Initialize SDK

Initialize the Aarc SDK with your API key:

const aarcCoreSDK = new AarcCore("YOUR_AARC_API_KEY");
5

Generate Deposit Address

Generate payload to enable bridging and custom user operations on the destination chain:

const depositData = await aarcCoreSDK.getDepositAddress(payload);

The deposit address generated will be active only for 30 minutes.

6

Wait for user deposit

Display the deposit details so the user can deposit funds.

7

Get transaction status

Get the status of the transaction

const depositStatus = await aarcCoreSDK.getRequestStatus(requestId);