open-index/open-npm huggingface dataset:
npm package: @markfender/runner
Description: Contract runner implementations for Circles SDK
Latest version: 0.1.0

# @markfender/runner

Safe multisig wallet integration for executing blockchain operations with the Circles SDK.

## Overview

This package provides the `SafeContractRunner` implementation for executing transactions through Safe multisig wallets. It handles transaction batching, signing, and confirmation, making it easy to interact with Circles protocol using Safe wallets.

## Installation

```bash
npm install @markfender/runner
```

## Usage

### SafeContractRunner

The `SafeContractRunner` executes transactions through a Safe multisig wallet.

```typescript
import { createPublicClient, http } from 'viem';
import { gnosis } from 'viem/chains';
import { SafeContractRunner } from '@markfender/runner';

// Create a public client
const publicClient = createPublicClient({
  chain: gnosis,
  transport: http('https://rpc.gnosischain.com'),
});

// Create the runner
const runner = new SafeContractRunner(
  publicClient,
  '0x...', // private key of Safe signer
  'https://rpc.gnosischain.com',
  '0x...' // Safe address
);

// Initialize the runner
await runner.init();

// Send a single transaction
const receipt = await runner.sendTransaction([{
  to: '0x...',
  data: '0x...',
  value: 0n,
}]);

console.log('Transaction hash:', receipt.transactionHash);
console.log('Status:', receipt.status);
console.log('Gas used:', receipt.gasUsed);

// Batch multiple transactions atomically
const batchReceipt = await runner.sendTransaction([
  { to: '0x...', data: '0x...', value: 0n },
  { to: '0x...', data: '0x...', value: 0n },
  { to: '0x...', data: '0x...', value: 0n },
]);
```

## Features

- **Transaction Confirmation**: Automatically waits for transactions to be mined
- **Status Checking**: Throws errors if transactions revert
- **Atomic Batching**: Execute multiple transactions in a single Safe transaction
- **Full Receipt Data**: Returns complete viem TransactionReceipt with gas, logs, etc.

## API

### ContractRunner Interface

```typescript
interface ContractRunner {
  address?: Address;
  publicClient: PublicClient;

  init(): Promise<void>;
  estimateGas?(tx: TransactionRequest): Promise<bigint>;
  call?(tx: TransactionRequest): Promise<string>;
  resolveName?(name: string): Promise<string | null>;
  sendTransaction?(txs: TransactionRequest[]): Promise<TransactionResponse>;
  sendBatchTransaction?(): BatchRun;
}
```

### SafeContractRunner

```typescript
class SafeContractRunner implements ContractRunner {
  constructor(
    publicClient: PublicClient,
    privateKey: Hex,
    rpcUrl: string,
    safeAddress?: Address
  );

  init(safeAddress?: Address): Promise<void>;
  sendTransaction(txs: TransactionRequest[]): Promise<TransactionResponse>;
  sendBatchTransaction(): SafeBatchRun;
}
```

## License

MIT
npm package: @markforster/info.markforster.helloworld
Description: A Hello World module to test publishing NPM modules
Author: markforster
Latest version: 0.0.4

# npm Module Publishing Boilerplate

A Hello World module to test publishing NPM modules

## Welcome
Welcome to the boilerplate project for publishing an npm module! This project serves as a guide and starting point for developers looking to publish their own npm modules. It provides a basic structure and setup, including essential files and configurations, to help you understand the necessary steps involved in creating and publishing an npm module. Whether you're a beginner or experienced developer, this boilerplate project will assist you in navigating the process of sharing your code with the wider JavaScript community. Happy coding and happy publishing!