open-index/open-npm huggingface dataset:
npm package: @talismn/preconstruct-cli
Description: Dev and build your code painlessly in monorepos
Latest version: 2.8.3

# Preconstruct 🎁

> Dev and build your code painlessly in monorepos

## Key Features

- In dev mode, your code behaves the same as it will in production, including locally linked in monorepos
- Add multiple entrypoints to your packages for publishing
- CLI helps walk you through set-up and making changes to your configs
- Works with different kinds of JS monorepos
- Also works for single package repos!
- Builds your code with rollup

## Getting Started

Assuming you already have a source file at src/index.js (or src/index.ts) or you're using Yarn Workspaces and have packages with src/index.js (or src/index.ts), you can setup Preconstruct like this.

```bash
yarn add --dev @preconstruct/cli
yarn preconstruct init
```

If you're in a monorepo, you should also run `yarn preconstruct dev` and add it to a postinstall script(`"postinstall": "preconstruct dev"`) that runs preconstruct dev so that you can import your code without having to rebuild your project every time in changes.

## Publishing packages

Before you publish packages to npm, run `preconstruct build`. reconstruct will use your Babel config and build flat bundles so make sure to [configure Babel](/guides/configuring-babel) with the transforms you want.

> We strongly recomment making a single script in your package.json that runs both build and publish, to stop broken publishes, such as `"release": "preconstruct build && yarn publish:packages`. If you're in a single-package repo, you could also run `preconstruct build` in a `prepare` or `prepublishOnly` script.

## Further Guides

There are a number of tasks that become easier with preconstruct that lie slightly outside the main workflow. Check out the following guides for setting these up.

- [A more detailed account of getting set up](https://preconstruct.tools/tutorials)
- [Setting up a second entrypoint](https://preconstruct.tools/guides/adding-a-second-entrypoint)
- [CLI command documentation](https://preconstruct.tools/commands)
- [Other configuration](https://preconstruct.tools/configuration)

# See the docs at [preconstruct.tools](https://preconstruct.tools)

# Thanks/Inspiration

- [microbundle](https://github.com/developit/microbundle) was a huge inspiration for this! ❤️
- [rollup](https://rollupjs.org) - rollup has done the really hard stuff that makes preconstruct possible!
- [bolt](https://github.com/boltpkg/bolt) - lots of utils and things in this project were inspired by things in bolt
- [Kye Hohenberger](https://github.com/tkh44) for thinking of the name preconstruct
- Too many awesome people to name at [Thinkmill](https://thinkmill.com.au) who have given so much great feedback to make Preconstruct better and Thinkmill for sponsoring the development of Preconstruct 💝
- all the people who wrote all the dependencies for this project!
npm package: @talismn/signet-apps-sdk
Description: Signet Apps Sdk
Author: chrisling-dev
Latest version: 0.0.7

# Signet Apps SDK

By integrating the Signet Apps SDK, your dapps can support multisig operations when users use your dapp within Signet.

## Documentation

### Installation

```bash
npm install @talismn/signet-apps-sdk
# or
yarn add @talismn/signet-apps-sdk
# or
bun add @talismn/signet-apps-sdk
```

### Using the SDK

Check out this [demo app](https://github.com/talismansociety/signet-apps-demo) for a complete example of how a dapp can support both EOA and multisig transactions with our SDK.

**init()**
Check whether user is using your dapp within Signet.

```javascript
import { SignetSdk } from "@talismn/signet-apps-sdk"
const sdk = new SignetSdk()

const inSignet = await sdk.init()
// true or false
```

If you're using React, we have a hook that handles that for you:

```tsx
import { useSignetSdk } from "@talismn/signet-apps-sdk"

const App = () => {
  const { inSignet } = useSignetSdk()

  if (inSignet) return <p>{/* Inject and display signet vault*/}</p>
  return <button>Connect wallet</button>
}
```

**getAccount()**
Inject the selected signet account into your dapp. The `sdk` is also exposed from our hook:

```tsx
import { useSignetSdk, VaultAccount } from "@talismn/signet-apps-sdk"

const App = () => {
  const { inSignet, sdk } = useSignetSdk()
  const [injectedVault, setInjectedVault] = useState<VaultAccount>()

  const getVault = useCallback(async () => {
    const vault = await sdk.getAccount()
    setInjectedVault(vault)
  }, [])

  // depending on how your dapp is built, you may want to trigger this via a button click instead of useEffect
  useEffect(() => {
    if (inSignet) getVault()
  }, [inSignet, getVault])

  if (inSignet && injectedVault)
    return (
      <div>
        <p>{injectedVault.name}</p>
        <p>{injectedVault.address}</p>
      </div>
    )

  // handle normal EOA flow
  return <button>Connect wallet</button>
}
```

**send(calldataHex: string)**
Send a transaction to Signet to be wrapped as a multisig transaction:

```javascript
import { SendTxRespond } from '@talismn/signet-apps-sdk'

const App = () => {
    // ...

    const submitTx = () => {
        // ...build extrinsic
        const res = await sdk.send(extrinsic.method.toHex())
        console.log(res) // returns SendTxRespond
    }

    // ...
}
```
npm package: @talismn/siws
Description: Sign-In with Substrate
Author: chrisling-dev
Latest version: 1.0.0

<br/>

<p align="center">
  <a href="https://siws.xyz">
      <picture>
        <source media="(prefers-color-scheme: dark)" srcset="https://github.com/TalismanSociety/siws/blob/main/assets/Logo-dark.svg">
        <img alt="siws logo" src="https://github.com/TalismanSociety/siws/blob/main/assets/Logo-light.svg" width="auto" height="60">
      </picture>
</a>
</p>
<p align="center">
  Sign-In with Substrate
<p>

<br>

![SIWS Example](https://github.com/TalismanSociety/siws/blob/main/assets/siws-example.png?raw=true "SIWS Example")

# Sign-In with Substrate

`@talismn/siws` is a package that lets you easily allow users to authenticate themselves with your off chain services by signing in with their Substrate accounts.

## Problem & Motivation

When building Signet, an enterprise tool for companies to manage their on-chain organisations in the Substrate ecosystem, we needed a way for users to prove that they own an address before they can request for resources relevant to that address. There was no solution yet that offered good user experience, where users could easily understand what they are signing with their wallet. Inspired by [Sign-in with Ethereum](https://github.com/spruceid/siwe), we decided to build the right tool for the Substrate ecosystem.

## Features

- Construct human readable sign in message
- Construct message in stringified JSON format
- Decode and parse string message of both format into JS object
- Basic validations (e.g. expiration)
- Utility `Address` to help with dealing with address string
- Utility `verifySIWS` to help verify that a signature is valid
- Full Typescript support

## Installation

```bash
$ npm install @talismn/siws
```

## Usage

### Frontend

```typescript
// 1. import necessary modules
import { web3FromSource } from "@polkadot/extension-dapp"
import { SiwsMessage } from "@talismn/siws"

// 2. handle sign in after `account` is selected
const handleSignIn = async () => {
  const siws = new SiwsMessage({
    domain: "localhost",
    uri: "http://localhost:3000/sign-in",
    address: account.address,
    nonce, // a challenge generated from backend
    statement: "Welcome to my dapp!",
  })

  // get the injector so we can sign the message
  const injectedExtension = await web3FromSource(account.meta.source)
  const signed = await siws.sign(injectedExtension)

  // api to sign in with backend
  await signIn(signed)
}
```

### Backend

```typescript
// 1. import siws
import { verifySIWS } from "@talismn/siws"

// 2. backend handler to handle sign in request
const handleSignInRequest = ({ signature, message, address }) => {
  // verify that signature is valid
  const siwsMessage = await verifySIWS(message, signature, address)

  // ... user has proven ownership of address and hence authenticated!
}
```

## Documentation

Check out our [full guide](https://docs.siws.xyz/) on how to implement SIWS into your dapp!

## Support

- [Talisman](https://talisman.xyz)
- [Web3 Foundation](https://grants.web3.foundation/)