JSPM

@onflow/sdk

0.0.14
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15092
  • Score
    100M100P100Q126574F
  • License Apache-2.0

Flow SDK

Package Exports

  • @onflow/sdk

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@onflow/sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@onflow/sdk

A collection of modules that make interacting with Flow easier.

Install

npm install --save @onflow/sdk

Usage

import * as sdk from "@onflow/sdk"
import * as t from "@onflow/types"

const ixBuilt = await sdk.build([
  sdk.script`
    pub fun main(): UFix64 {
      let a = ${p => p.a}
      let b = ${p => p.b}
      return a + b
    }
  `,
  sdk.params([sdk.param(5, t.UFix64, "a"), sdk.param(6, t.UFix64, "b")]),
])

const ixResolved = await sdk.resolve(ixBuild, [sdk.resolveParams])

const response = await sdk.send(ixResolved, {
  node: "accessNode url",
})

const result = await sdk.decodeResponse(response, {
  UFix64: v => BigInt(v),
})

console.log(result === 11n) // true

Exposes