open-index/open-npm huggingface dataset:
npm package: @futureverse/asset-registry-sdk
Description: ## Installation
Latest version: 0.28.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Futureverse Asset Registry SDK

## Installation

NPM:

```bash
    npm install @futureverse/asset-registry-sdk --save
```

Yarn:

```bash
    yarn add @futureverse/asset-registry-sdk
```

## Usage

```typescript
import {
  AssetRegistryClientProvider,
  Namespace,
  useCreateShaclSchema,
} from './index'
import { render } from 'react-dom'
import { ethers } from 'ethers'

const ASSET_REGISTRY_ENDPOINT = 'http://localhost:4000/graphql'
const APP_DOMAIN = 'com.fv.app'
const WALLET_PRIVATE_KEY = ''

function App() {
  return (
    // Provide the client to your App
    <AssetRegistryClientProvider
      url={ASSET_REGISTRY_ENDPOINT}
      domain={APP_DOMAIN}
      chainId={1}
    >
      <CreateShaclSchemaComponent />
    </AssetRegistryClientProvider>
  )
}

function CreateShaclSchemaComponent() {
  const wallet = new ethers.Wallet(WALLET_PRIVATE_KEY ?? '')
  const origin = 'http://localhost:3000'
  const id = 'foo'
  const version = 1
  const namespace = 'com.fv.schemas' as Namespace
  const schema = '{}'

  const mutation = useCreateShaclSchema({
    wallet,
    schema,
    version,
    origin,
    namespace,
  })

  return (
    <div>
      {mutation.isLoading ? (
        'Adding Shacl Schema...'
      ) : (
        <>
          {mutation.isError ? (
            <div>An error occurred: {mutation.error as string}</div>
          ) : null}

          {mutation.isSuccess ? <div>Shacl Schema added!</div> : null}

          <button onClick={() => mutation.mutate()}>Create Shacl Schema</button>
        </>
      )}
    </div>
  )
}

render(<App />, document.getElementById('root'))
```

## Requirements
npm package: @futureverse/auth
Description: Provides an Open ID Connect Authentication library for FuturePass.
Latest version: 5.0.3

# Futureverse Auth

Provides an Open ID Connect Authentication library for FuturePass.

## Installation

npm:

```bash
    npm install @futureverse/auth --save
```

yarn:

```bash
    yarn add @futureverse/auth
```

pnpm:

```bash
    pnpm add @futureverse/auth
```

bun:

```bash
    bun add @futureverse/auth
```

## Register your client

First, you will need to register an OAuth2 client with the Pass Online Identity Provider using the Manage Clients Console:

- **Production:** https://login.pass.online/manageclients
- **Development / Staging:** https://login.passonline.cloud/manageclients

## Usage

**PKCE Auth Client Setup**

Use the same client ID and redirect URI for the environment you configured your client in.

```typescript
import { FutureverseAuthClient } from '@futureverse/auth';

const authClient = new FutureverseAuthClient({
  clientId: '<your-client-id>',
  environment: 'production',
  redirectUri: '<your-redirect-uri>',
  postLogoutRedirectUri: '<your-post-logout-redirect-uri>',
});
```

**Sign in**

For Web3 wallet authentication, a signer interface is required. The user needs to sign a message so the identity service can verify their identity.

Signer adapters are available from the [Signer SDK](https://www.npmjs.com/package/@futureverse/signer).

For custodial authentication, set type as email, facebook, google, tiktok or x.

```typescript
import { EthereumSigner } from '@futureverse/signer';
...
// Sign in custodial options with popup
const type = 'eoa' // 'eoa' is for web3 wallet sign in
const address = '<selected-web3-wallet-address>';
const signer: Signer = new EthereumSigner(...);

await authClient.signInPass({
    type, // eoa | email | facebook | google | tiktok | x
    address,
    state,
    signer,
    authFlow, //'popup' | 'redirect' | 'silent' 
    responseMode, //'query' | 'fragment' | 'form_post' | 'web_message'
});

```

**Handle Redirect**

Once the user has signed in, they will be redirected to the redirect URI that was set up in the client. This step is required for the user session to be updated and any open sign in popups to close automatically.

```typescript
...
await authClient.verifyAndLoadUser();
```

**Getting the user**

This method can return the current user if signed in.

```typescript
...
await authClient.getUser();
```

**Sessions**

The session object contains the user object as well as the FuturePass address and EOA address.

```typescript
...
const session = authClient.userSession;
const futurepassAddress = session.futurepass;
const eoaAddress = session.eoa;
const user = session.user;
```

**Sign out**

```typescript
...
await authClient.signOutPass({ 
    flow: 'redirect', // redirect | silent
    postRedirecturi: '<post_logout_redirect_uri>' // optional
    disableConsent: false // "true" by default
});
```
npm package: @futureverse/auth-core
Description: Provides common functionality / internals for Futureverse auth
Latest version: 1.0.2

# Futureverse Auth Core

Provides common functionality / internals for Futureverse auth

## Installation

npm:
```bash
    npm install @futureverse/auth-core --save
```

yarn:

```bash
    yarn add @futureverse/auth-core
```
npm package: @futureverse/auth-react
Description: Provides a React authentication provider for [Futureverse Auth](https://www.npmjs.com/package/@futureverse/auth).
Latest version: 5.0.4

# Futureverse Auth React

Provides a React authentication provider for [Futureverse Auth](https://www.npmjs.com/package/@futureverse/auth).

## Installation

NPM:

```bash
    npm install @futureverse/auth-react --save
```
```bash
    npm install wagmi viem@2.x @tanstack/react-query
```

Yarn:

```bash
    yarn add @futureverse/auth-react
    yarn add wagmi viem@2.x @tanstack/react-query
```

## Usage

**Config.ts**
```typescript
import { FutureverseAuthClient } from '@futureverse/auth-react';
import { createWagmiConfig } from '@futureverse/wagmi-connectors';
import { QueryClient } from '@tanstack/react-query';
import { mainnet, sepolia } from 'viem/chains';
import { cookieStorage, createStorage } from 'wagmi';

// Create your auth client
export const authClient = new FutureverseAuthClient({
  clientId: '<your-futureverse-client-id>',
  redirectUri: 'http://localhost:3000',
  signInFlow: 'redirect', // 'redirect' | 'popup'
  // Optional configuration
  authorizationURL: 'https://login.passonline.cloud', // Optional - defaults to production
  signerURL: 'https://signer.passonline.cloud', // Optional - defaults to production
  postLogoutRedirectUri: 'http://localhost:3000',
  hostWeb3SigningDomain: 'localhost:3000',
  chainId: 7672, // Optional - defaults to TRN Mainnet 
});

// Create query client
export const queryClient = new QueryClient();
```

**Providers.tsx**
```tsx
// For NextJS App Router if using NextJS client
'use client';

import { FutureverseAuthProvider } from '@futureverse/auth-react';
import { AuthUiProvider } from '@futureverse/auth-ui';
import { QueryClientProvider } from '@tanstack/react-query';
import { authClient, queryClient, wagmiConfig } from './config';

export default function Providers({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <QueryClientProvider client={queryClient}>
        <FutureverseAuthProvider authClient={authClient}>
          {children}
        </FutureverseAuthProvider>
    </QueryClientProvider>
  );
}
```
npm package: @futureverse/mint-sdk-react
Description: ## Installation
Latest version: 2.0.0

# Futureverse Mint SDK React

## Installation

NPM:

```bash
    npm install @futureverse/mint-sdk-react --save
```

Yarn:

```bash
    yarn add @futureverse/mint-sdk-react
```

## Usage

```typescript
import {
  TrnApiProvider,
  useCreateAndSendExtrinsic,
  useTrnApi,
} from '@futureverse/mint-sdk-react';
import { useCallback } from 'react';
import { useSigner } from 'wagmi';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

function useCreateMintExtrinsic(
  collectionId: string,
  numberOfTokens: number,
  owner: string
) {
  const { trnApi } = useTrnApi();
  return trnApi.tx.nft.mint(collectionId, numberOfTokens, owner);
}

function ExtrinsicDemo() {
  const { trnApi } = useTrnApi();
  const { data: signer } = useSigner();

  const collectionId = '<your collection id>';
  const numberOfTokens = 1; // How many tokens to mint
  const address = 'FuturePass or address to mint to';
  const extrinsic = useCreateMintExtrinsic(
    collectionId,
    numberOfTokens,
    address
  );

  const { mutateAsync } = useCreateAndSendExtrinsic(trnApi);

  const submitTransaction = useCallback(async () => {
    if (!signer) return;
    const { result } = await mutateAsync({
      account: address,
      extrinsic,
      signer,
    });

    return result;
  }, [extrinsic, mutateAsync, signer]);

  // Your UI code to call submitTransaction
  return <></>;
}

const queryClient = new QueryClient();

function DemoApp() {
  return (
    // Provide a TRN API provider to your application
    // If using @futureverse/react you can exclude this provider
    // import { useTrnApi } from '@futureverse/react';
    <QueryClientProvider client={queryClient}>
      <TrnApiProvider network="porcini">
        <ExtrinsicDemo />
      </TrnApiProvider>
    </QueryClientProvider>
  );
}
```
npm package: @futureverse/rpc-kit
Description: Build simple and type-safe RPC interfaces with TypeScript and io-ts.
Latest version: 0.1.3
Deprecated: This package is deprecated and no longer maintained. Please do not use it.

# @futureverse/rpc-kit

Build simple and type-safe RPC interfaces with TypeScript and io-ts.

**Features:**

- Client-side cancellation
- Server-side cancellation
- Server->Client events
- Strong types verified at runtime
- Tiny and unobtrusive
- Transport agnostic
- No code-gen
- No boilerplate
- Simple, safe error handling
- Extensible

# Maintainers

- [Felix Schlitter](https://github.com/felixschl) (Author)
npm package: @futureverse/signer
Description: Provides a signer interface with common methods for signing messages, transactions and extrinsics.
Latest version: 1.8.0

# Futureverse Signer

Provides a signer interface with common methods for signing messages, transactions and extrinsics.

## Installation

NPM:

```bash
    npm install @futureverse/signer --save
```

Yarn:

```bash
    yarn add @futureverse/signer
```

## Usage

### Wagmi useFutureverseSigner Hook

The example below shows how to create a hook (useFutureverseSigner) to get the signer interface from wagmi wallet client.

```typescript
import { clientToSigner } from '@futureverse/signer';
import { useMemo } from 'react';
import { type Connector, useWalletClient } from 'wagmi';

/** Action to convert a Viem Client to a Futureverse Signer. */
export function useFutureverseSigner({ chainId, connector }: { chainId?: number; connector?: Connector } = {}) {
  const { data: client } = useWalletClient({ chainId, connector });

  return useMemo(() => (client ? clientToSigner(client) : undefined), [client]);
}
```

### Signing a message

```typescript
import { useCallback } from 'react';
import { useFutureverseSigner } from './useFutureverseSigner';

function MessageSignerDemo() {
  const { signer } = useFutureverseSigner();

  const signExtrinsic = useCallback(async () => {
    if (!signer) return;
    const message = 'message to sign';
    return await signer.signMessage(message);
  }, [signer]);

  // Your UI code to call signExtrinsic
  return <></>;
}
```

### Signing a Root Network extrinsic

```typescript
import { userSession } from '@futureverse/auth';
import { useTrnApi } from '@futureverse/transact-react';
import { useCallback } from 'react';
import { useFutureverseSigner } from './useFutureverseSigner';

function ExtrinsicSignerDemo() {
  const { userSession } = useAuth();
  const { trnApi } = useTrnApi();
  const { signer } = useFutureverseSigner();

  const signExtrinsic = useCallback(async () => {
    if (!signer) return;
    if (!trnApi) return;
    if (!userSession?.eoa) return;
    const collectionId = '<your collection id>';
    const numberOfTokens = 1; // How many tokens to mint
    const address = 'FuturePass or address to mint to';
    const extrinsic = trnApi.tx.nft.mint(collectionId, numberOfTokens, address);
    return await signer.signExtrinsic(trnApi, extrinsic, userSession.eoa);
  }, [signer]);

  // Your UI code to call signExtrinsic
  return <></>;
}
```
npm package: @futureverse/stateboss
Description: ``` yarn add @futureverse/stateboss ```
Latest version: 0.1.3
Deprecated: This package is deprecated and no longer maintained. Please do not use it.

# @futureverse/stateboss

```
yarn add @futureverse/stateboss
```

## Features

- Seamless & type-safe state management
  - Export porcelain interfaces from containers
  - Access interface from anywhere in the hierarchy
- First class logging support (via `@sylo/logger`)
  - Completely optional
  - Containers always get a contextualized logger
  - Ships with no-op and console.log loggers
  - Grab a logger anywhere with `useLogger`

## Example

```typescript
import React from 'react';
import * as L from '@sylo/logger';
import { createContainer, LoggerProvider, useLogger, Logger } from '@futureverse/stateboss';

function useCounterImpl(logger: Logger): {
  increment(): void;
  decrement(): void;
  counter: number;
} {
  const [counter, setCounter] = React.useState(0);
  const increment = React.useCallback(() => {
    logger.d('incrementing!');
    setCounter((x) => x + 1);
  }, []);
  const decrement = React.useCallback(() => {
    logger.d('decrementing!');
    setCounter((x) => x - 1);
  }, []);
  return {
    counter,
    increment,
    decrement,
  };
}

const { Provider: CounterProvider, useContainer: useCounter } = createContainer(useCounterImpl);

function MyComponent() {
  const { counter, increment, decrement } = useCounter();
  const logger = useLogger();
  React.useEffect(() => {
    logger.d('counter updated: ', counter);
  }, [counter, /* stable: */ logger]);
  return (
    <div>
      <div>counter: {counter}</div>
      <div>
        <button onClick={increment}>+</button>
        <button onClick={decrement}>-</button>
      </div>
    </div>
  );
}

function MyApp() {
  return (
    <LoggerProvider logger={L.consoleLogger}>
      <CounterProvider>
        <MyComponent />
      </CounterProvider>
    </LoggerProvider>
  );
}
```

## Maintainers

- [Felix Schlitter](https://github.com/felixschl) (Author)
- [Darpan Patil](https://github.com/developer-darpan)
npm package: @futureverse/sylo-data-protocol
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.3.0

# sylo-data-protocol

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build sylo-data-protocol` to build the library.

## Running unit tests

Run `nx test sylo-data-protocol` to execute the unit tests via [Vitest](https://vitest.dev/).
npm package: @futureverse/wagmi-connectors
Description: Provides Wagmi extensions for Futureverse wallets.
Latest version: 4.0.4

# Futureverse Wagmi Connectors

Provides Wagmi extensions for Futureverse wallets.

## Installation

NPM:

```bash
    npm install @futureverse/wagmi-connectors --save
```

Yarn:

```bash
    yarn add @futureverse/wagmi-connectors 
```

## Usage

### Wagmi Config Setup Example

This example shows how to create a wagmi config with Xaman futureverse wallet connector. The code also uses [Futureverse Auth React](https://www.npmjs.com/package/@futureverse/auth-react).

```typescript
import { createConfig, http } from 'wagmi';
import { mainnet, sepolia } from 'wagmi/chains';
import { coinbaseWallet, metaMask, walletConnect } from 'wagmi/connectors';
import { root, porcini } from '@futureverse/auth';
import { xamanWallet, futureverseCustodialWallet } from '@futureverse/wagmi-connectors';

const wagmiConfig = createConfig({
  chains: [mainnet, sepolia, root, porcini],
  connectors: [
    futureverseCustodialWallet({ authClient, custodialType: 'email' }),
    futureverseCustodialWallet({
      authClient,
      custodialType: 'facebook',
    }),
    futureverseCustodialWallet({ authClient, custodialType: 'google' }),
    metaMask({
      dappMetadata: {
        name: 'FuturePass',
      },
    }),
    coinbaseWallet({
      appName: 'FuturePass',
    }),
    ...(xamanApiKey
      ? [
          xamanWallet({
            apiKey: xamanApiKey,
            onQR: xamanOnQRCode,
            onSign: xamanOnSigned,
            authClient,
            flow,
          }),
        ]
      : []),
    ...(walletConnectProjectId ? [walletConnect({ projectId: walletConnectProjectId })] : []),
  ],
  transports: {
    [mainnet.id]: http(),
    [sepolia.id]: http(),
    [root.id]: http(),
    [porcini.id]: http(),
  },
});
```