open-index/open-npm huggingface dataset:
npm package: @routerprotocol/router-pay-core
Description: Core library for RouterPay
Author: Joydeep Singha
Latest version: 1.0.3

# Router Pay Core

Core library for Router Pay. Expand your dapp to anychain in walletless integration.

## Installation

```bash
npm install @routerprotocol/router-pay-core
```

## Usage

```typescript
import RouterPay from '@routerprotocol/router-pay-core';
```

Initializes a new instance of the RouterPay class.

- `config`: An object containing:

  - `quoteUrl` (optional): Custom quote URL
  - `transactionUrl` (optional): Custom transaction URL
  - `partnerId`: Partner ID for RouterPay

  ```typescript
  const routerPay = new RouterPay({
    quoteUrl: 'https://api-beta.pathfinder.routerprotocol.com/api/v2/quote',
    transactionUrl: 'https://btc-testnet.poap-nft.routernitro.com/internal',
    partnerId: 123456,
  });
  ```

## Methods

### getQuote

Retrieves a quote for a payment.

```typescript
const quote = await routerPay.getQuote({
  amount: 100,
  currency: 'USD',
  partnerId: 123456,
});
```

### createTransaction

Creates a transaction for a payment.

```typescript
const transaction = await routerPay.createTransaction({
  quote: quote,
  senderAddress: '0x1234567890123456789012345678901234567890',
  receiverAddress: '0x0987654321098765432109876543210987654321',
});
```

### Wait for transaction

Waits for a transaction to be confirmed.

```typescript
const transaction = await routerPay.waitForTransaction(transaction.depositMeta);
```
npm package: @routerprotocol/xplore-widget
Description: Xplore cross-chain swap widget — standalone, framework-agnostic React component
Latest version: 0.1.1

# @routerprotocol/xplore-widget

Drop-in React widget for cross-chain token swaps powered by [Router Protocol](https://routerprotocol.com).

## Install

```bash
npm i @routerprotocol/xplore-widget
```

## Usage

```tsx
import { BlinqWidget, WidgetProvider } from '@routerprotocol/xplore-widget';
import '@routerprotocol/xplore-widget/style.css';

const config = {
  apiUrl: 'https://your-grpc-endpoint',
  networkConfigUrl: 'https://your-app/api/networks',
  environmentId: 'YOUR_DYNAMIC_LABS_ENV_ID',
};

export default function App() {
  return (
    <WidgetProvider config={config}>
      <BlinqWidget />
    </WidgetProvider>
  );
}
```

## Config

| Property | Type | Required | Description |
|---|---|---|---|
| `apiUrl` | `string` | yes | Router Protocol gRPC API endpoint |
| `networkConfigUrl` | `string` | yes | URL serving network config JSON |
| `environmentId` | `string` | yes | Dynamic Labs environment ID |
| `balanceApiUrl` | `string` | no | Balance API URL (falls back to RPC) |
| `supportedChainIds` | `string[]` | no | Restrict to specific chain IDs |

## Peer Dependencies

- `react` ^18.2.0 || ^19.0.0
- `react-dom` ^18.2.0 || ^19.0.0

## Links

- [Router Protocol Docs](https://docs.routerprotocol.com)
- [Router Protocol](https://routerprotocol.com)