open-index/open-npm huggingface dataset:
npm package: @rhildred/cors-proxy2
Description: cors proxy to expose in a cloudflare pages function
Author: Rich Hildred
Latest version: 1.0.9

# cors-proxy2
[Cloudflare worker ](https://developers.cloudflare.com/pages/platform/functions/) to run with [Stackblitz.com](https://stackblitz.com) and [github.com](https://github.com).

To use:

`npm install --save-dev @rhildred/cors-proxy2`

put the url in the query string. For instance:

```javascript
        const res = await request(app)
        .get("/proxy?url=https://github.com/diy-pwa/diy-pwa/archive/refs/heads/main.zip");


```

Consume in cloudflare pages function. For instance in `functions/corsproxy/[[corsproxy]].js`:

```javascript
import { CorsProxyResponse } from '@rhildred/cors-proxy2';

export async function onRequest(context){
    return CorsProxyResponse.fetch(context.request, context.env);
}

```
or as a worker I think
```javascript
import { CorsProxyResponse } from '@rhildred/cors-proxy2';
export { CorsProxyResponse as default };
```

This code is based on the [cors-proxy](https://github.com/isomorphic-git/cors-proxy) code from isomorphic-git. It is refactored to be exposed as a cloudflare worker or pages function.

I am consuming the cloudflare pages function in [diy-pwa](https://github.com/diy-pwa/diy-pwa) and [git-pwa](https://github.com/diy-pwa/git-pwa). These projects are for a [stackblitz](https://stackblitz.com) development environment for sales engineers to make progressive web apps. The pwa is for hosting .svg configuration models and complements for business to business products.
npm package: @rhildred/preact-custom-element
Description: Wrap your component up as a custom element
Latest version: 4.3.1

# preact-custom-element

Generate/register a custom element from a preact component. As of 3.0.0, this library implements the Custom Elements v1 spec.
Previous versions (< 3.0.0) implemented the v0 proposal, which was only implemented in Chrome and is abandoned.

## Usage

Import `register` and call it with your component, a tag name<strong>*</strong>, and a list of attribute names you want to observe:

```javascript
import register from 'preact-custom-element';

const Greeting = ({ name = 'World' }) => (
  <p>Hello, {name}!</p>
);

register(Greeting, 'x-greeting', ['name']);
```

> _**\* Note:** as per the [Custom Elements specification](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name), the tag name must contain a hyphen._

Use the new tag name in HTML, attribute keys and values will be passed in as props:

```html
<x-greeting name="Billy Jo"></x-greeting>
```

Output:

```html
<p>Hello, Billy Jo!</p>
```

### Prop Names and Automatic Prop Names

The Custom Elements V1 specification requires explictly stating the names of any attributes you want to observe. From your Preact component perspective, `props` could be an object with any keys at runtime, so it's not always clear which props should be accepted as attributes.

If you omit the third parameter to `register()`, the list of attributes to observe can be specified using a static `observedAttributes` property on your Component. This also works for the Custom Element's name, which can be specified using a `tagName` static property:

```js
import register from 'preact-custom-element';

// <x-greeting name="Bo"></x-greeting>
class Greeting extends Component {
  // Register as <x-greeting>:
  static tagName = 'x-greeting';

  // Track these attributes:
  static observedAttributes = ['name'];

  render({ name }) {
    return <p>Hello, {name}!</p>;
  }
}
register(Greeting);
```

If no `observedAttributes` are specified, they will be inferred from the keys of `propTypes` if present on the Component:

```js
// Other option: use PropTypes:
function FullName(props) {
  return <span>{props.first} {props.last}</span>
}
FullName.propTypes = {
  first: Object,   // you can use PropTypes, or this
  last: Object     // trick to define untyped props.
};
register(FullName, 'full-name');
```

## Scoped css

There is a 4th argument to register for an options object. If you want scoped css you need to set `shadow` to `true` and `adoptedStyleSheets` to have the style sheet as a `CSSStyleSheet` attached to your shadow dom.

```javascript
register(Scoped, "x-scoped", [], {shadow:true, adoptedStyleSheets:[sheet]});
```

For a complete example look at `index.html` and `src/main.jsx` in this repository


## Related

[preact-shadow-dom](https://github.com/bspaulding/preact-shadow-dom)
npm package: @rhinestone/automations-sdk
Description: A TypeScript library for using Rhinestone Automations
Author: Rhinestone
Latest version: 0.0.3

# Automations SDK

![Coverage badge lines](https://raw.githubusercontent.com/rhinestonewtf/automations-sdk/main/badges/badge-lines.svg)
![Coverage badge functions](https://raw.githubusercontent.com/rhinestonewtf/automations-sdk/main/badges/badge-functions.svg)

**A TypeScript library for using Rhinestone Automations**

The Rhinestone Automations Service allows you to create automations that will be executed on a smart account based on a trigger. Exisiting triggers include:

- **Time-based trigger**: Execute an automation at a specified time interval
- **Event-based trigger**: Execute an automation based on an event emitted onchain

This SDK makes it easy to interact with the Rhinestone Automations Service and create, sign and manage automations.

## Using the Automations SDK

### Installation

Install the Automations SDK:

```bash
npm install @rhinestone/automations-sdk
```

```bash
pnpm install @rhinestone/automations-sdk
```

```bash
yarn add @rhinestone/automations-sdk
```

```bash
bun install @rhinestone/automations-sdk
```

### Quick Start


```typescript
// Import the required functions
import {
  createAutomationClient,
} from '@rhinestone/automations-sdk'

// Create a client for the automations service
const automationsClient = createAutomationClient({
      account: "0xc2b17e73603dccc195118a36f3203134fd7985f5",
      apiKey: process.env.AUTOMATIONS_API_KEY!,
      accountInitCode: '0x',
      network: 11155111,
      validator: '0x503b54Ed1E62365F0c9e4caF1479623b08acbe77',
})

// Create a new automation
const automation = await automationsClient.createAutomation({
      type: 'time-based',
      data: {
        trigger: {
          triggerData: {
            cronExpression: '*/30 * * * * *',
            startDate: new Date().getTime(),
          },
        },
        actions: [
          {
            type: 'static',
            target: '0x503b54Ed1E62365F0c9e4caF1479623b08acbe77',
            value: 100,
            callData: '0x',
          },
        ],
        maxNumberOfExecutions: 10,
      },
})

// Sign the automation to active it
const signature = sign(automation.hash) // Sign the hash of the automation with the account

await automationsClient.signAutomation({
      automationId: automation.id,
      signature: signature,
})

// Get the automation and verify that it is active
automation = await automationsClient.getAutomation(
      automationId: automation.id,
)

console.log(automation.status) // active
```

## Using this repo

To install dependencies, run:

```bash
pnpm install
```

To build the sdk, run:

```bash
pnpm build
```

To run tests, run:

```bash
pnpm test
```

## Contributing

For feature or change requests, feel free to open a PR, start a discussion or get in touch with us.
npm package: @rhinestone/erc4337-validation
Description: A library to validate the ERC-4337 rules within Foundry
Author: Rhinestone
Latest version: 0.0.5

# ERC4337 Validation

**A library to validate the [ERC-4337 rules](https://eips.ethereum.org/EIPS/eip-7562) within Foundry**

This library allows you to validate:

- [x] Banned opcodes
- [x] Banned storage locations
- [x] Disallowed `*CALLs`
- [x] Disallowed use of `EXT*` opcodes
- [x] Disallowed use `CREATE` opcode

It also supports both `v0.6` and `v0.7` of ERC-4337.

> This library is in active development and is subject to breaking changes. If you spot a bug, please take out an issue and we will fix it as soon as we can.

## Using the library

### Installation

#### With Foundry

```bash
forge install rhinestonewtf/erc4337-validation
```

#### With a package manager

```bash
pnpm i @rhinestone/erc4337-validation
```

### Usage

To use this library, simply import the `Simulator` and set it up as follows:

```solidity
contract Example {
    using Simulator for PackedUserOperation; // or UserOperation

   function verify(PackedUserOperation memory userOp) external view {
        // Verify the ERC-4337 rules
        userOp.simulateUserOp(entryPointAddress);
    }
}
```

If the userOp breaks any of the rules, the function will revert with a message indicating which rule was broken.

Note that the `entryPointAddress` needs to be the address of the `EntryPointSimulations` contract if you are using v0.7 of ERC-4337. For an example see the [Simulator test](./test/Simulator.t.sol), the [Simulator test v0.6](./test/SimulatorV060.t.sol) and the relevant [test bases](./test/utils).

## Using this repo

To install the dependencies, run:

```bash
pnpm install
```

To build the project, run:

```bash
forge build
```

To run the tests, run:

```bash
forge test
```

## Contributing

For feature or change requests, feel free to open a PR, start a discussion or get in touch with us.

## Credits

- [Dror](https://github.com/drortirosh): For the implementation approach and an initial prototype
npm package: @rhinestone/orchestrator-sdk
Description: A TypeScript library for using the Rhinestone Orchestrator
Author: Rhinestone
Latest version: 0.2.0-rc.19
Deprecated: This SDK is no longer supported. Please switch to '@rhinestone/sdk' to continue getting updates.

# Orchestrator SDK

**A TypeScript Library for Interacting with the Rhinestone Orchestrator**

> **Important:** The Orchestrator is currently under development. While the SDK and APIs are relatively stable, please anticipate ongoing improvements and potential breaking changes in the coming weeks.

### For Developers

The Orchestrator SDK provides the following capabilities:

- **Create a User Account Cluster:** Add accounts across multiple chains to a single cluster.
- **Fetch Total Portfolio Balance:** Retrieve the overall balance of a user account cluster.
- **Obtain Order Bundles:** Get an order bundle for a specific meta intent associated with a user account.
- **Sign Order Bundles:** Utilize an ownable validator to sign order bundles (please create an issue for support regarding specific validators).
- **Post Signed Order Bundles:** Submit signed order bundles to the orchestrator for processing by relayers.
- **Check Order Bundle Status:** Monitor the status of submitted order bundles.

Additionally, the Orchestrator SDK exposes useful types and ABIs that developers can leverage when interacting with the Orchestrator.

### For Solvers

If you are looking for a mock implementation of a relayer, please visit our [Rhinestone Relayer Repository](https://github.com/rhinestonewtf/rhinestone-relayer).

For comprehensive documentation on the Chain Abstraction System, please refer to: [Chain Abstraction Docs](https://rhinestone.notion.site/Chain-Abstraction-Docs-External-4790f4303e934b16a6fb24637e6f67e7?pvs=4).

For API documentation, visit: [Swagger Docs](https://orchestrator-prototype-38oyp.ondigitalocean.app/api-docs/).

### Note

> You need an API key to interact with most useful Orchestrator functions. If you're interested in building on top of our system, please reach out to the team.

## Using the Orchestrator SDK

### Installation

```bash
npm install viem @rhinestone/orchestrator-sdk
```

```bash
pnpm install viem @rhinestone/orchestrator-sdk
```

```bash
yarn add viem @rhinestone/orchestrator-sdk
```

```bash
bun install viem @rhinestone/orchestrator-sdk
```

### Quick Start

```typescript
Coming soon ...

( Please refer to the tests for now )
```

## Using this repo

To install dependencies, run:

```bash
pnpm install
```

To build the sdk, run:

```bash
pnpm build
```

To run tests, run:

```bash
pnpm test
```

## Contributing

For feature or change requests, feel free to open a PR, start a discussion or get in touch with us.