open-index/open-npm huggingface dataset:
npm package: @onflow/six-unstake-delegated-flow
Description: Flow SDK Stored Interaction - Unstake Delegated Flow
Author: Dapper Labs
Latest version: 0.0.13

# @onflow/six-unstake-delegated-flow

Stored Interaction for unstaking delegated Flow

# Status

- **Last Updated:** April 28 2021
- **Stable:** No
- **Risk of Breaking Change:** Very High

Known Upcoming Changes:

- Potential changes to all aspects of Stored Interactions

# Install

npm install @onflow/six-unstake-delegated-flow

# Configuration 

To use this Stored Interaction, you must configure FCL with certain account addresses which contain contracts imported by this Stored Interaction.

| Dependencies          | Mainnet            | Testnet            |
| --------------------- | ------------------ | ------------------ |
| 0xLOCKEDTOKENADDRESS  | 0x8d0e87b65159ae63 | 0x95e019a17d0e23d7 |

Example (for mainnet):

```javascript
fcl.config()
  .put("0xLOCKEDTOKENADDRESS", "0x8d0e87b65159ae63")
```

Example (for testnet):

```javascript
fcl.config()
  .put("0xLOCKEDTOKENADDRESS", "0x95e019a17d0e23d7")
```

# Usage:

```javascript
import * as fcl from "@onflow/fcl"
import { template as unstakeDelegatedFlow } from "@onflow/six-unstake-delegated-flow"

fcl.config().put("accessNode", "http://localhost:8080");

const response = await fcl.send([
    unstakeDelegatedFlow({
        proposer: fcl.currentUser().authorization,
        authorization: fcl.currentUser().authorization,     
        payer: fcl.currentUser().authorization,             
        amount: "123.456",                                    // Amount as a String representing a Cadence UFix64
    })
])

```

# Hashing

Hashing Code:
```javascript
    console.log(crypto.createHash('sha256').update(CODE, 'utf8').digest('hex'))
```
npm package: @onflow/six-unstake-flow
Description: Flow SDK Stored Interaction - Unstake Flow
Author: Dapper Labs
Latest version: 0.0.15

# @onflow/six-unstake-flow

Stored Interaction for Unstaking Flow.

# Status

- **Last Updated:** April 28 2021
- **Stable:** No
- **Risk of Breaking Change:** Very High

Known Upcoming Changes:

- Potential changes to all aspects of Stored Interactions

# Install

npm install @onflow/six-unstake-flow

# Configuration 

To use this Stored Interaction, you must configure FCL with certain account addresses which contain contracts imported by this Stored Interaction.

| Dependencies          | Mainnet            | Testnet            |
| --------------------- | ------------------ | ------------------ |
| 0xSTAKINGPROXYADDRESS | 0x62430cf28c26d095 | 0x7aad92e5a0715d21 |
| 0xLOCKEDTOKENADDRESS  | 0x8d0e87b65159ae63 | 0x95e019a17d0e23d7 |

Example (for mainnet):

```javascript
fcl.config()
  .put("0xSTAKINGPROXYADDRESS", "0x62430cf28c26d095")
  .put("0xLOCKEDTOKENADDRESS", "0x8d0e87b65159ae63")
```

Example (for testnet):

```javascript
fcl.config()
  .put("0xSTAKINGPROXYADDRESS", "0x7aad92e5a0715d21")
  .put("0xLOCKEDTOKENADDRESS", "0x95e019a17d0e23d7")
```

# Usage:

```javascript
import * as fcl from "@onflow/fcl"
import { template as unstakeFlow } from "@onflow/six-unstake-flow"

fcl.config().put("accessNode", "http://localhost:8080");

const response = await fcl.send([
    unstakeFlow({
        proposer: fcl.currentUser().authorization,
        authorization: fcl.currentUser().authorization,     
        payer: fcl.currentUser().authorization,             
    })
])

```

# Hashing

Hashing Code:
```javascript
    console.log(crypto.createHash('sha256').update(CODE, 'utf8').digest('hex'))
```
npm package: @onflow/six-usdc-setup
Description: Flow SDK Stored Interaction - USDC Setup
Author: Dapper Labs
Latest version: 0.0.6

# @onflow/six-usdc-setup

Stored Interaction for setting up a USDC Vault and Receiver

# Status

- **Last Updated:** March 21 2022
- **Stable:** No
- **Risk of Breaking Change:** Very High

Known Upcoming Changes:

- Potential changes to all aspects of Stored Interactions

# Install

npm install @onflow/six-usdc-setup

# Configuration 

To use this Stored Interaction, you must configure FCL with certain account addresses which contain contracts imported by this Stored Interaction.

| Dependencies           | Mainnet            | Testnet            |
| ---------------------- | ------------------ | ------------------ |
| 0xFUNGIBLETOKENADDRESS | 0xf233dcee88fe0abe | 0x9a0766d93b6608b7 |
| 0xUSDCADDRESS          | 0xb19436aae4d94622 | 0x1ab3c177460e1e4a |

Example (for mainnet):

```javascript
fcl.config()
  .put("0xFUNGIBLETOKENADDRESS", "0xf233dcee88fe0abe")
  .put("0xUSDCADDRESS", "0xb19436aae4d94622")
```

Example (for testnet):

```javascript
fcl.config()
  .put("0xFUNGIBLETOKENADDRESS", "0x9a0766d93b6608b7")
  .put("0xUSDCADDRESS", "0x1ab3c177460e1e4a")
```

Learn more about configuring FCL here: https://github.com/onflow/fcl-six/blob/master/docs/configure-fcl.mdx

# Usage:

```javascript
import * as fcl from "@onflow/fcl"
import { template as usdcSetup } from "@onflow/six-usdc-setup"

fcl.config().put("accessNode", "http://localhost:8080");

const response = await fcl.send([
    usdcSetup({
        proposer: fcl.currentUser().authorization,
        authorization: fcl.currentUser().authorization,     
        payer: fcl.currentUser().authorization,             
    })
])

```

# Hashing

Hashing Code:
```javascript
    console.log(crypto.createHash('sha256').update(CODE, 'utf8').digest('hex'))
```
npm package: @onflow/six-usdc-transfer
Description: Flow SDK Stored Interaction - USDC Transfer
Author: Dapper Labs
Latest version: 0.0.4

# @onflow/six-usdc-setup

Stored Interaction for transferring USDC between Flow accounts.

# Status

- **Last Updated:** March 21 2022
- **Stable:** No
- **Risk of Breaking Change:** Very High

Known Upcoming Changes:

- Potential changes to all aspects of Stored Interactions

# Install

npm install @onflow/six-usdc-transfer

# Configuration 

To use this Stored Interaction, you must configure FCL with certain account addresses which contain contracts imported by this Stored Interaction.

| Dependencies           | Mainnet            | Testnet            |
| ---------------------- | ------------------ | ------------------ |
| 0xFUNGIBLETOKENADDRESS | 0xf233dcee88fe0abe | 0x9a0766d93b6608b7 |
| 0xUSDCADDRESS          | 0xb19436aae4d94622 | 0x1ab3c177460e1e4a |

Example (for mainnet):

```javascript
fcl.config()
  .put("0xFUNGIBLETOKENADDRESS", "0xf233dcee88fe0abe")
  .put("0xUSDCADDRESS", "0xb19436aae4d94622")
```

Example (for testnet):

```javascript
fcl.config()
  .put("0xFUNGIBLETOKENADDRESS", "0x9a0766d93b6608b7")
  .put("0xUSDCADDRESS", "0x1ab3c177460e1e4a")
```

Learn more about configuring FCL here: https://github.com/onflow/fcl-six/blob/master/docs/configure-fcl.mdx

# Usage:

```javascript
import * as fcl from "@onflow/fcl"
import { template as usdcSetup } from "@onflow/six-usdc-transfer"

fcl.config().put("accessNode", "http://localhost:8080");

const response = await fcl.send([
    usdcTransfer({
        proposer: fcl.currentUser().authorization,
        authorization: fcl.currentUser().authorization,     
        payer: fcl.currentUser().authorization,        
        amount: "123.456",                                    // Amount as a String representing a Cadence UFix64
        to: "0xABC123DEF456"                                  // The Address of the Account to transfer FUSD to.     
    })
])

```

# Hashing

Hashing Code:
```javascript
    console.log(crypto.createHash('sha256').update(CODE, 'utf8').digest('hex'))
```
npm package: @onflow/six-withdraw-rewarded-delegated-flow
Description: Flow SDK Stored Interaction - Withdraw Rewarded Delegated Flow
Author: Dapper Labs
Latest version: 0.0.14

# @onflow/six-withdraw-rewarded-delegated-flow

Stored Interaction for withdrawing rewarded delegated tokens on Flow.

# Status

- **Last Updated:** April 28 2021
- **Stable:** No
- **Risk of Breaking Change:** Very High

Known Upcoming Changes:

- Potential changes to all aspects of Stored Interactions

# Install

npm install @onflow/six-withdraw-rewarded-delegated-flow

# Configuration 

To use this Stored Interaction, you must configure FCL with certain account addresses which contain contracts imported by this Stored Interaction.

| Dependencies          | Mainnet            | Testnet            |
| --------------------- | ------------------ | ------------------ |
| 0xFLOWTOKENADDRESS    | 0x1654653399040a61 | 0x7e60df042a9c0868 |
| 0xLOCKEDTOKENADDRESS  | 0x8d0e87b65159ae63 | 0x95e019a17d0e23d7 |

Example (for mainnet):

```javascript
fcl.config()
  .put("0xFLOWTOKENADDRESS", "0x1654653399040a61")
  .put("0xLOCKEDTOKENADDRESS", "0x8d0e87b65159ae63")
```

Example (for testnet):

```javascript
fcl.config()
  .put("0xFLOWTOKENADDRESS", "0x7e60df042a9c0868")
  .put("0xLOCKEDTOKENADDRESS", "0x95e019a17d0e23d7")
```

# Usage:

```javascript
import * as fcl from "@onflow/fcl"
import { template as withdrawRewardedDelegatedFlow } from "@onflow/six-withdraw-rewarded-delegated-flow"

fcl.config().put("accessNode", "http://localhost:8080");

const response = await fcl.send([
    withdrawRewardedDelegatedFlow({
        proposer: fcl.currentUser().authorization,
        authorization: fcl.currentUser().authorization,     
        payer: fcl.currentUser().authorization,             
        amount: "123.456",                                    // Amount as a String representing a Cadence UFix64
    })
])

```

# Hashing

Hashing Code:
```javascript
    console.log(crypto.createHash('sha256').update(CODE, 'utf8').digest('hex'))
```
npm package: @onflow/six-withdraw-rewarded-flow
Description: Flow SDK Stored Interaction - Withdraw Rewarded Flow
Author: Dapper Labs
Latest version: 0.2.1

# @onflow/six-withdraw-rewarded-flow

Stored Interaction for withdrawing rewarded tokens on Flow.

# Status

- **Last Updated:** April 28 2021
- **Stable:** No
- **Risk of Breaking Change:** Very High

Known Upcoming Changes:

- Potential changes to all aspects of Stored Interactions

# Install

npm install @onflow/six-withdraw-rewarded-flow

# Configuration 

To use this Stored Interaction, you must configure FCL with certain account addresses which contain contracts imported by this Stored Interaction.

| Dependencies          | Mainnet            | Testnet            |
| --------------------- | ------------------ | ------------------ |
| 0xFLOWTOKENADDRESS    | 0x1654653399040a61 | 0x7e60df042a9c0868 |
| 0xLOCKEDTOKENADDRESS  | 0x8d0e87b65159ae63 | 0x95e019a17d0e23d7 |

Example (for mainnet):

```javascript
fcl.config()
  .put("0xFLOWTOKENADDRESS", "0x1654653399040a61")
  .put("0xLOCKEDTOKENADDRESS", "0x8d0e87b65159ae63")
```

Example (for testnet):

```javascript
fcl.config()
  .put("0xFLOWTOKENADDRESS", "0x7e60df042a9c0868")
  .put("0xLOCKEDTOKENADDRESS", "0x95e019a17d0e23d7")
```

# Usage:

```javascript
import * as fcl from "@onflow/fcl"
import { template as withdrawRewardedFlow } from "@onflow/six-withdraw-rewarded-flow"

fcl.config().put("accessNode", "http://localhost:8080");

const response = await fcl.send([
    withdrawRewardedFlow({
        proposer: fcl.currentUser().authorization,
        authorization: fcl.currentUser().authorization,     
        payer: fcl.currentUser().authorization,             
        amount: "123.456",                                    // Amount as a String representing a Cadence UFix64
    })
])

```

# Hashing

Hashing Code:
```javascript
    console.log(crypto.createHash('sha256').update(CODE, 'utf8').digest('hex'))
```
npm package: @onflow/six-withdraw-unlocked-flow
Description: Flow SDK Stored Interaction - Withdraw Unlocked Flow
Author: Dapper Labs
Latest version: 0.3.2

# @onflow/six-withdraw-unlocked-flow

Stored Interaction for withdrawing unlocked tokens on Flow.

# Status

- **Last Updated:** April 28 2021
- **Stable:** No
- **Risk of Breaking Change:** Very High

Known Upcoming Changes:

- Potential changes to all aspects of Stored Interactions

# Install

npm install @onflow/six-withdraw-unlocked-flow

# Configuration 

To use this Stored Interaction, you must configure FCL with certain account addresses which contain contracts imported by this Stored Interaction.

| Dependencies           | Mainnet            | Testnet            |
| ---------------------- | ------------------ | ------------------ |
| 0xFLOWTOKENADDRESS     | 0x1654653399040a61 | 0x7e60df042a9c0868 |
| 0xLOCKEDTOKENADDRESS   | 0x8d0e87b65159ae63 | 0x95e019a17d0e23d7 |
| 0xFUNGIBLETOKENADDRESS | 0xf233dcee88fe0abe | 0x9a0766d93b6608b7 |

Example (for mainnet):

```javascript
fcl.config()
  .put("0xFLOWTOKENADDRESS", "0x1654653399040a61")
  .put("0xLOCKEDTOKENADDRESS", "0x8d0e87b65159ae63")
  .put("0xFUNGIBLETOKENADDRESS", "0xf233dcee88fe0abe")
```

Example (for testnet):

```javascript
fcl.config()
  .put("0xFLOWTOKENADDRESS", "0x7e60df042a9c0868")
  .put("0xLOCKEDTOKENADDRESS", "0x95e019a17d0e23d7")
  .put("0xFUNGIBLETOKENADDRESS", "0x9a0766d93b6608b7")
```

# Usage:

```javascript
import * as fcl from "@onflow/fcl"
import { template as withdrawUnlockedFlow } from "@onflow/six-withdraw-unlocked-flow"

fcl.config().put("accessNode", "http://localhost:8080");

const response = await fcl.send([
    withdrawUnlockedFlow({
        proposer: fcl.currentUser().authorization,
        authorization: fcl.currentUser().authorization,     
        payer: fcl.currentUser().authorization,             
        amount: "123.456",                                    // Amount as a String representing a Cadence UFix64
    })
])

```

# Hashing

Hashing Code:
```javascript
    console.log(crypto.createHash('sha256').update(CODE, 'utf8').digest('hex'))
```
npm package: @onflow/six-withdraw-unstaked-delegated-flow
Description: Flow SDK Stored Interaction - Withdraw Unstaked Delegated Flow
Author: Dapper Labs
Latest version: 0.0.13

# @onflow/six-withdraw-unstaked-delegated-flow

Stored Interaction for withdrawing unstaked delegated tokens on Flow.

# Status

- **Last Updated:** April 28 2021
- **Stable:** No
- **Risk of Breaking Change:** Very High

Known Upcoming Changes:

- Potential changes to all aspects of Stored Interactions

# Install

npm install @onflow/six-withdraw-unstaked-delegated-flow

# Configuration 

To use this Stored Interaction, you must configure FCL with certain account addresses which contain contracts imported by this Stored Interaction.

| Dependencies           | Mainnet            | Testnet            |
| ---------------------- | ------------------ | ------------------ |
| 0xLOCKEDTOKENADDRESS   | 0x8d0e87b65159ae63 | 0x95e019a17d0e23d7 |

Example (for mainnet):

```javascript
fcl.config()
  .put("0xLOCKEDTOKENADDRESS", "0x8d0e87b65159ae63")
```

Example (for testnet):

```javascript
fcl.config()
  .put("0xLOCKEDTOKENADDRESS", "0x95e019a17d0e23d7")
```

# Usage:

```javascript
import * as fcl from "@onflow/fcl"
import { template as withdrawUnstakedDelegatedFlow } from "@onflow/six-withdraw-unstaked-delegated-flow"

fcl.config().put("accessNode", "http://localhost:8080");

const response = await fcl.send([
    withdrawUnstakedDelegatedFlow({
        proposer: fcl.currentUser().authorization,
        authorization: fcl.currentUser().authorization,     
        payer: fcl.currentUser().authorization,             
        amount: "123.456",                                    // Amount as a String representing a Cadence UFix64
    })
])

```

# Hashing

Hashing Code:
```javascript
    console.log(crypto.createHash('sha256').update(CODE, 'utf8').digest('hex'))
```
npm package: @onflow/six-withdraw-unstaked-flow
Description: Flow SDK Stored Interaction - Withdraw Unstaked Flow
Author: Dapper Labs
Latest version: 0.0.14

# @onflow/six-withdraw-unstaked-flow

Stored Interaction for withdrawing unstaked tokens on Flow.

# Status

- **Last Updated:** April 28 2021
- **Stable:** No
- **Risk of Breaking Change:** Very High

Known Upcoming Changes:

- Potential changes to all aspects of Stored Interactions

# Install

npm install @onflow/six-withdraw-unstaked-flow

# Configuration 

To use this Stored Interaction, you must configure FCL with certain contract addresses.

| Dependencies          | Mainnet            | Testnet            |
| --------------------- | ------------------ | ------------------ |
| 0xLOCKEDTOKENADDRESS  | 0x8d0e87b65159ae63 | 0x95e019a17d0e23d7 |
| 0xSTAKINGPROXYADDRESS | 0x62430cf28c26d095 | 0x7aad92e5a0715d21 |

Example (for mainnet):

```javascript
fcl.config()
  .put("0xLOCKEDTOKENADDRESS", "0x8d0e87b65159ae63")
  .put("0xSTAKINGPROXYADDRESS", "0x62430cf28c26d095")
```

Example (for testnet):

```javascript
fcl.config()
  .put("0xLOCKEDTOKENADDRESS", "0x95e019a17d0e23d7")
  .put("0xSTAKINGPROXYADDRESS", "0x7aad92e5a0715d21")
```

# Usage:

```javascript
import * as fcl from "@onflow/fcl"
import { template as withdrawUnstakedFlow } from "@onflow/six-withdraw-unstaked-flow"

fcl.config().put("accessNode", "http://localhost:8080");

const response = await fcl.send([
    withdrawUnstakedFlow({
        proposer: fcl.currentUser().authorization,
        authorization: fcl.currentUser().authorization,     
        payer: fcl.currentUser().authorization,             
        amount: "123.456",                                    // Amount as a String representing a Cadence UFix64
    })
])

```

# Hashing

Hashing Code:
```javascript
    console.log(crypto.createHash('sha256').update(CODE, 'utf8').digest('hex'))
```
npm package: @onflow/transport-http
Description: Flow SDK HTTP Transport Module
Author: Flow Foundation
Latest version: 1.15.6

---
title: Transport HTTP
description: Sends an interaction to an access node via the HTTP Rest API and returns a response.
---

# @onflow/transport-http

A transport module which can send an interaction to an access node via the HTTP Rest api specification and return a response.

## Status

- **Last Updated:** Jan 13th 2022
- **Stable:** Yes
- **Risk of Breaking Change:** Medium

This package is working and in active development, breaking changes may happen.

## Install

```bash
npm install --save @onflow/transport-http
```
npm package: @onflow/typedefs
Description: Flow JS Type Defs
Author: Flow Foundation
Latest version: 1.8.0

JSDoc typedefs and TypeScript types.

```typescript

import {CurrentUser} from "@onflow/typedefs"

const newUser: CurrentUser = { 
  addr: null,
  cid: null,
  expiresAt: null,
  f_type: 'User',
  f_vsn: '1.0.0',
  loggedIn: null,
  services: []
}

```
npm package: @onflow/util-actor
Description: A mechanism for forcing order/transitions of scoped async state
Author: Flow Foundation
Latest version: 1.3.5

### Actor

> Asynchronous self-contained isolated state, can only be comunicated with via a first-in/first-out message queue called a mailbox.

Please see the tests for examples.

As this is an unstable internal tool used by the SDK and FCl, using it directly from your code is a massive risk.

We will have documentation once we consider this utility stable.
npm package: @onflow/util-address
Description: Flow JS SDK Util -- Address
Author: Flow Foundation
Latest version: 1.2.4

```javascript

import {withPrefix, sansPrefix, display} from "@onflow/util-address"

const address = "0xc88ff43f1a87c679"
assert(sansPrefix(address), "c88ff43f1a87c679")

assert(withPrefix(address), address)
assert(withPrefix(sansPrefix(address)), address)

const Comp = ({ address }) => {
  return <div>
    <strong>Flow Address</strong>
    <span>{display(address)}</span>
  </div>
}

```
npm package: @onflow/util-encode-key
Description: Flow JS SDK Util -- Encode Key
Author: Flow Foundation
Latest version: 1.2.5

# Encode Key

Encodes public keys so that the Flow Blockchain can use them.

You can learn more about keys, curves, hashes, weights and signing here: https://github.com/onflow/flow/blob/master/docs/content/concepts/accounts-and-keys.md#supported-signature--hash-algorithms

```javascript
import { template as addNewKey } from "@onflow/six-add-new-key"
import * as fcl from "@onflow/fcl"

import {encodeKey, ECDSA_P256, SHA3_256} from "@onflow/util-encode-key"

// The key you want to use to sign transactions later
const PUBLIC_KEY = "0bfcd8790c3ce88f3fac9d4bd23514f48bf0cdd1f6c3c8bdf87b11489b1bbeca1ef805ec2ee76451e9bdb265284f78febaeacbc8b0827e0a7baafee4e655d0b5"

const ENCODED_KEY = encodeKey(
  PLUBLIC_KEY, // The key to encode (DER Hex)
  ECDSA_P256,  // The curve Flow needs to use with your key [ECDSA_P256|ECDSA_secp256k1]
  SHA3_256,    // The hashing algorythm Flow needs to use with your key [SHA2_256|SHA3_256]
  1000         // The weight you want this key to have [Range: 0..1000]
)

const authz = fcl.currentUser().authorization

const resp = await fcl.send([
  addNewKey({
    publicKey: [ENCODED_KEY],
    proposer: authz,
    payer: authz,
    authorization: authz
  })
])

```
npm package: @onflow/util-invariant
Description: Flow JS SDK Util -- Invariant
Author: Flow Foundation
Latest version: 1.2.5

```javascript
import {invariant} from "@onflow/util-invariant"

function add(a, b) {
  invariant(typeof a === "number", "add(a, b) -- `a` needs to be a number", { a, b })
  invariant(typeof b === "number", "add(a, b) -- `b` needs to be a number", { a, b })
  return a + b
}
```
npm package: @onflow/util-logger
Description: Logger for FCL-JS
Author: Flow Foundation
Latest version: 1.3.4

# @onflow/util-logger

Logger for FCL-JS.

# Status

- **Last Updated:** March 30 2022
- **Stable:** Yes
- **Risk of Breaking Change:** No

# Install

```bash
npm install --save @onflow/util-logger
```

# Usage

## Logger Levels

| Name    | Value |
| ------- | ----- |
| `error` |   1   |
| `warn`  |   2   |
| `log`   |   3   |
| `info`  |   4   |
| `debug` |   5   |

```javascript
import * as logger from "@onflow/util-logger"

// This will fire if the config "logger.level" value is set to the error level or above
logger.log({
  title: "Title of error", 
  message: "Message body", 
  level: logger.LEVELS.error
})
```

## Deprecation

This package also exposes a useful method for logging deprecation warnings via `log.deprecate`.  The function accepts an object with the following keys as its parameters.

 - `pkg` (optional) - The package which the deprecated feature belongs to (i.e. `FCL/SDK`, `@onflow/util-invariant`, etc.).  If not provided it defaults to an empty string and will not show in the notice.
 - `subject` (optional) - The feature that is being deprecated (i.e. `"Passing a start and end into getEvents"`).
 - `transition`  (optional) - The URL to the transition guide for the deprecation
 - `level` (optional) - The [logger level](https://github.com/onflow/fcl-js/tree/master/packages/util-logger#logger-levels) of the deprecation notice (default LEVELS.warn)
 - `message` (optional) - An additional message to provide the user about the deprecation.  Will ap
 - `callback` (optional) -

Deprecation notice format:
```javascript
 `${pkg} Deprecation Notice
============================

${subject} is deprecated and will cease to work in future releases of ${pkg}.
${message}
You can learn more (including a guide on common transition paths) here: ${transition}

============================`
```
The lines with `subject`, `message`, and `transition` will not appear if these values are not provided.  
  
Example usage:
```javascript
import * as logger from "@onflow/util-logger"

logger.log.deprecate({
  pkg: "FCL/SDK",
  subject: "Passing a start and end into getEvents",
  transition:
    "https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0005-deprecate-start-end-get-events-builder",
})
```
npm package: @onflow/util-node-http-modules
Description: Flow SDK Util Get Node Http Modules
Author: Dapper Labs
Latest version: 1.0.2

---
title: Util Node Http Modules
description: Environment conditional Node Http(s) module loader
---

# @onflow/util-node-http-modules

Environment conditional Node Http(s) module loader

## Status

- **Last Updated:** March 3rd 2022
- **Stable:** Yes
- **Risk of Breaking Change:** High

This package is working and in active development, breaking changes may happen.

## Install

```bash
npm install --save @onflow/util-node-http-modules
```
npm package: @onflow/util-rpc
Description: Lightweight utility for creating transport-agnostic, bidirectional JSON-RPC channels.
Author: Flow Foundation
Latest version: 0.0.3

# @onflow/util-rpc

Lightweight utility for creating transport-agnostic, bidirectional JSON-RPC channels.

# Status

- **Last Updated:** Aug 6th, 2024
- **Stable:** No
- **Risk of Breaking Change:** Yes

# Install

```bash
npm install --save @onflow/util-rpc
```

# Usage

```javascript
import {RpcClient} from "@onflow/util-rpc"

const rpc = new RpcClient(...)
rpc.connect(...)
```
npm package: @onflow/util-template
Description: Template Literal used for Cadence Interop
Author: Flow Foundation
Latest version: 1.2.4

# template

Utility to help with string interop in SDK and FCL

## Usage

```javascript
import {templar} from "onflow/template"

const template = templar`
From: ${o => o.from}
To: ${o => o.to}
Message: ${o => o.msg}
`

const letter = template({
  from: "Bob the Builder",
  to: "Postman Pat",
  msg: "Please pick up your black and white cat.",
})

// prettier-ignore
assert( letter, `
From: Bob the Builder
To: Postman Pat
Message: Please pick up your black and white cat.
`)
```

```javascript
import {templar} from "@onflow/template"

const template1 = templar`
a: ${o => o.a}
b: ${o => o.b}
`

const template2 = templar`
x: ${o => o.x}
y: ${o => o.y}
`

const template3 = templar`
${template1}
${template2}
oh hello!
${template1}
${template2}
`

const rawr = template3({a: "A", b: "B", x: "X", y: "Y"})

// prettier-ignore
assert(rawr, `
a: A
b: B
x: X
y: Y
oh hello!
a: A
b: B
x: X
y: Y
`)
```

## Examples

**Role your own graphql libary**

```javascript
// gql.js
import {templar} from "@onflow/template"

export const gql = templar

export const gqlr = (...args) => (opts = {}) => {
  const params = opts.params || {}
  const headers = opts.headers || {}
  const endpoint = opts.endpoint || ""

  return fetch(endpoint, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      ...headers,
    },
    body: JSON.stringify({
      query: gql(...args)(params),
    }),
  }).then(d => d.json())
}

// somewhere-else.js
import React, {useEffect, useState} from "react"
import {gqlr, gql} from "./gql"

const USER = gql`
  fragment USER on User {
    username
  }
`

const query = gqlr`
  query {
    me { ...USER }
  }
  ${USER}
`

export const Username = () => {
  const [username, setUsername] = useState(null)

  useEffect(() => {
    query({
      endpoint: "http://...",
      headers: {authorization: "bearer ..."},
    }).then(response => setUsername(response.data.me.username))
  }, [])

  return username == null ? null : username
}
```

**Role your own pipeline thing?**

```javascript
const pipe = (fns = []) => token => {
  return fns.reduce((token, fn) => fn(token), token)
}

const param = (key, value) => token => {
  token.params = token.parms || {}
  token.params[key] = value
  return token
}

const script = (...args) => token => {
  token.type = "script"
  token.value = templar(...args)(token.params)
  return token
}

const query = (...args) => token => {
  token.type = "query"
  token.value = templar(...args)(token.parms)
  return token
}

const desc = (...args) => token => {
  token.description = templar(...args)(token.params)
  return token
}

const rawr = pipe([
  param("msg", "woot woot im a boot"),
  script`
    pub fun main() {
      log("msg: ${o => o.msg}")
    }
  `,
  desc`
    the message: ${o => o.msg}
  `,
])

assert(rawr, {
  params: {
    msg: "woot woot im a boot",
  },
  type: "script",
  code: `
    pub fun main() {
      log("msg: woot woot im a boot")
    }
  `,
  descrition: `
    the message: woot woot im a boot
  `,
})
```
npm package: @onflow/util-uid
Description: Utilities to generate Unique Identifiers
Author: Flow Foundation
Latest version: 1.2.4

# @onflow/util-rpc

Lightweight utility for transport-agnostic, bidirectional RPC communication.

# Status

- **Last Updated:** Aug 6th, 2024
- **Stable:** No
- **Risk of Breaking Change:** Yes

# Install

```bash
npm install --save @onflow/util-rpc
```

# Usage

```javascript
import {RpcClient} from "@onflow/util-rpc"

const uniqueIdentifier = new RpcClient(...)
```