open-index/open-npm huggingface dataset:
npm package: @shieldswap/l1-transact
Description: L1 Transact allows to call any function on Ethereum L1 from Aztec L2.
Latest version: 0.48.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# L1 Transact by ShieldSwap

L1 Transact allows to call any function on Ethereum L1 from Aztec L2.

## Installation

```sh
npm add @shieldswap/l1-transact
```

## Examples

### DCA example

Continuously buys WETH with USDC. Under 100 lines of code. <https://github.com/ShieldSwap/dca-example>.

### Other examples

```ts
import { L1TransactSdk } from '@shieldswap/l1-transact'

const ethersAccount = new ethers.Wallet('0x<private key>')
const aztecAccount = (await getInitialTestAccountsWallets(pxe))[0];

const sdk = await L1TransactSdk.deploy({
  pxeUrl: PXE_URL,
  l1Deployer: ethersAccount,
  l2Deployer: aztecAccount,
});

// register a token on L2
import { CurrencyAmount, Token } from '@uniswap/sdk-core';
const usdc = new Token(...);
await sdk.l2RegisterTokenIfNotRegistered(usdc);

// example of bridging tokens from L1 to L2
await sdk.bridgeTokensFromL1ToL2({
  l1From: ethersAccount,
  l2To: aztecAccount,
  amounts: [
    CurrencyAmount.fromRawAmount(
      usdc,
      "123" // raw units
    ),
  ],
});

// example of bridging tokens from L2 to L1
await sdk.bridgeTokensFromL2ToL1({
  l2From: aztecAccount,
  l1To: ethersAccount,
  amounts: [
    CurrencyAmount.fromRawAmount(
      usdc,
      "123" // raw units
    ),
  ],
});

// example of executing a trade on L1 using L2 tokens
const amountIn = CurrencyAmount.fromRawAmount(usdc, "100000");
const amountOutMin = CurrencyAmount.fromRawAmount(weth, "1");
await sdk.transactOnL1WithL2Tokens({
  l2Account,
  amountsIn: [amountIn],
  amountsOutMin: [amountOutMin],
  call: {
    to: "0x1234", // uniswap router address
    data: "0x1111" // uniswap router calldata
  },
});
```
npm package: @shieldswap/l1-transact-l1-contracts
Description: This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.
Latest version: 0.0.9
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.

Try running some of the following tasks:

```shell
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.ts
```
npm package: @shieldswap/wallet-sdk
Description: Connect your Aztec app to any Aztec wallet.
Latest version: 0.84.0-next.0
Deprecated: use @nemi-fi/wallet-sdk

# Aztec Wallet SDK

Connect your Aztec app to any Aztec wallet.

## EIP-1193 RPC docs

```ts
// before
import { Wallet } from "@aztec/aztec.js";
const account: Wallet;
const token = await TokenContract.at(address, account);

// after
import { AztecWalletSdk, obsidion } from "@shieldswap/wallet-sdk";
import { Contract } from "@shieldswap/wallet-sdk/eip1193";

class Token extends Contract.fromAztec(TokenContract) {}

const sdk = new AztecWalletSdk({
  aztecNode: "http://localhost:8080",
  connectors: [obsidion({ projectId: "reown-project-id" })],
});
await sdk.connect("obsidion");
const account = await sdk.getAccount();
const token = await Token.at(address, account);
```

## React

```tsx
import { useAccount } from "@shieldswap/wallet-sdk/react";

function App() {
  const account = useAccount(sdk);
  return <div>{account.address.toString()}</div>;
}
```

## Convert aztec.js Wallet to Account

```ts
import { createAztecNodeClient } from "@aztec/aztec.js";
import { type Account, Eip1193Account } from "@shieldswap/wallet-sdk/eip1193";

const [wallet] = await getDeployedTestAccountsWallets(pxe);

const aztecNode = createAztecNodeClient("http://localhost:8080");
const account: Account = Eip1193Account.fromAztec(wallet, pxe, aztecNode);
```